C
Caddiy
Sun, Oct 18, 2020 1:05 AM
It doesn't seem to be possible to show some kind of nameplate in the corner
of a picture that stays put when the design is rotated or moved about. That
would be useful for the name of the design, author, date/version etc.
Shouldn't be that difficult?
http://forum.openscad.org/file/t2925/frame00001.png
BTW Does this forum do animated .gifs?
--
Sent from: http://forum.openscad.org/
It doesn't seem to be possible to show some kind of nameplate in the corner
of a picture that stays put when the design is rotated or moved about. That
would be useful for the name of the design, author, date/version etc.
Shouldn't be that difficult?
<http://forum.openscad.org/file/t2925/frame00001.png>
BTW Does this forum do animated .gifs?
--
Sent from: http://forum.openscad.org/
M
MichaelAtOz
Sun, Oct 18, 2020 2:54 AM
You can use these variables
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#$vpr,_$vpt,_$vpf_and_$vpd
to make something face way you want.
http://forum.openscad.org/file/t359/1284801paper_fighting.gif
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
- on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
You can use these variables
<https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#$vpr,_$vpt,_$vpf_and_$vpd>
to make something face way you want.
<http://forum.openscad.org/file/t359/1284801paper_fighting.gif>
-----
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
MF
Michael Frey
Sun, Oct 18, 2020 9:20 AM
On 18.10.20 03:05, Caddiy wrote:
BTW Does this forum do animated .gifs?
I do:
https://de.wikipedia.org/wiki/Benutzer:MichaelFrey#3D-Animationen
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Example/Strandbeest
For the purpose of commons/wikipedia, watermarking is not well liked.
I rarely publish the code of the animation, as I feel like I have to
polish the code before publication.
(as seen with the Strandbeest Example)
The 2D animations are in javascript - that code has become impossible to
publish, as I use messy copy paste code.
One tip I like to give: For high quality render, you can use OpenSCAD to
create STL Files, which then can be animated and rendered in POV-Ray.
The result of my test looked like this:
https://commons.wikimedia.org/wiki/File:Question_Mark_3D_Animation_POV-Ray.gif
https://de.wikipedia.org/wiki/Benutzer:MichaelFrey#/media/Datei:Strandbeest_POV-Ray_3D.gif
I Love the transparency of the GIF and the possibility to use textures,
but creating a stable rendering chain requires three seperates pieces of
code (OpenSCAD for creating the STL File, POV-Ray to import, rotate and
render, Bash Script to glue it together). POV-Ray is a power full
language in its own right, but OpenSCAD is easier to learn and easier to
model with, easier to animate with, so the POV-Ray strandbeest, I used a
script to generate each leg position in OpenSCAD and export it to STL.
All the POV-Ray script does is instantiate 6 legs in the correct angle
and rotate and position them.
With Kind regards,
Michael Frey
On 18.10.20 03:05, Caddiy wrote:
> BTW Does this forum do animated .gifs?
I do:
https://de.wikipedia.org/wiki/Benutzer:MichaelFrey#3D-Animationen
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Example/Strandbeest
For the purpose of commons/wikipedia, watermarking is not well liked.
I rarely publish the code of the animation, as I feel like I have to
polish the code before publication.
(as seen with the Strandbeest Example)
The 2D animations are in javascript - that code has become impossible to
publish, as I use messy copy paste code.
One tip I like to give: For high quality render, you can use OpenSCAD to
create STL Files, which then can be animated and rendered in POV-Ray.
The result of my test looked like this:
https://commons.wikimedia.org/wiki/File:Question_Mark_3D_Animation_POV-Ray.gif
https://de.wikipedia.org/wiki/Benutzer:MichaelFrey#/media/Datei:Strandbeest_POV-Ray_3D.gif
I Love the transparency of the GIF and the possibility to use textures,
but creating a stable rendering chain requires three seperates pieces of
code (OpenSCAD for creating the STL File, POV-Ray to import, rotate and
render, Bash Script to glue it together). POV-Ray is a power full
language in its own right, but OpenSCAD is easier to learn and easier to
model with, easier to animate with, so the POV-Ray strandbeest, I used a
script to generate each leg position in OpenSCAD and export it to STL.
All the POV-Ray script does is instantiate 6 legs in the correct angle
and rotate and position them.
With Kind regards,
Michael Frey
C
Caddiy
Mon, Oct 19, 2020 5:31 PM
You can use these variables
<https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#$vpr,$vpt,$vpf_and_$vpd>
to make something face way you want.
So the possibility does exist. That's good to know. I had previously
stumbled across the section on $vpr, $vpt, $vpf and $vpd in the User Manual
but it talks about moving the viewport, whereas I want to fix an object I
have created. My viewport (PC monitor) is fine where it is on my desk and
moving it would not help anyway, I thought, and moved on.
Now, "Moving the viewport does not update them" sounds promising but there
is unfortunately no indication of how to actually fix one object in a
particular position while leaving the rest free to move.
So the next question is: How are $vpr, $vpt, $vpf and $vpd used to fix an
individual object in the lower right corner of the display? Could you give a
code example?
--
Sent from: http://forum.openscad.org/
You can use these variables
<https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#$vpr,_$vpt,_$vpf_and_$vpd>
to make something face way you want.
So the possibility does exist. That's good to know. I had previously
stumbled across the section on $vpr, $vpt, $vpf and $vpd in the User Manual
but it talks about moving the viewport, whereas I want to fix an object I
have created. My viewport (PC monitor) is fine where it is on my desk and
moving it would not help anyway, I thought, and moved on.
Now, "Moving the viewport does not update them" sounds promising but there
is unfortunately no indication of how to actually fix one object in a
particular position while leaving the rest free to move.
So the next question is: How are $vpr, $vpt, $vpf and $vpd used to fix an
individual object in the lower right corner of the display? Could you give a
code example?
--
Sent from: http://forum.openscad.org/
C
Caddiy
Mon, Oct 19, 2020 6:11 PM
On 18.10.20 03:05, Caddiy wrote:
BTW Does this forum do animated .gifs?
On 18.10.20 03:05, Caddiy wrote:
> BTW Does this forum do animated .gifs?
I do:
https://de.wikipedia.org/wiki/Benutzer:MichaelFrey#3D-Animationen
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Example/Strandbeest
Some very nice animations!
You would probably like Charles Parsons' steam engine of 1877.
--
Sent from: http://forum.openscad.org/
M
MichaelAtOz
Mon, Oct 19, 2020 10:56 PM
So the possibility does exist. That's good to know.
Could you give a code example?
Here is one for inspiration to get you started.
// turn on animation
$vpr = [$vpr[0], 0, $t * 360]; // animated rotate around Z
echo($vpt=$vpt,$vpr=$vpr,$vpd=$vpd); //,$vpf=$vpf);
// object of interest
cube([75,20,50]);
// oriented message
translate([25,25,100])
rotate([$vpr[0],$vpr[1],$vpr[2]])
text(str("$vpr=",$vpr[2]),size=10);
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
- on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
Caddiy wrote
> So the possibility does exist. That's good to know.
>
> Could you give a code example?
Here is one for inspiration to get you started.
// turn on animation
$vpr = [$vpr[0], 0, $t * 360]; // animated rotate around Z
echo($vpt=$vpt,$vpr=$vpr,$vpd=$vpd); //,$vpf=$vpf);
// object of interest
cube([75,20,50]);
// oriented message
translate([25,25,100])
rotate([$vpr[0],$vpr[1],$vpr[2]])
text(str("$vpr=",$vpr[2]),size=10);
-----
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
M
MichaelAtOz
Mon, Oct 19, 2020 11:06 PM
That had some line break problems in the email, check the forum to get the
right one.
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
- on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
That had some line break problems in the email, check the forum to get the
right one.
-----
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
C
Caddiy
Tue, Oct 20, 2020 2:15 PM
That had some line break problems in the email, check the forum to get the
right one.
So it's got some built-in errors, right?
--
Sent from: http://forum.openscad.org/
That had some line break problems in the email, check the forum to get the
right one.
So it's got some built-in errors, right?
--
Sent from: http://forum.openscad.org/
M
MichaelAtOz
Tue, Oct 20, 2020 10:33 PM
So it's got some built-in errors, right?
Not sure what you mean?
Every so often emails from the forum lose line breaks, I don't know where it
happens.
e.g. This is what I got:
// turn on animation
$vpr = [$vpr[0], 0, $t * 360]; // animated rotate around Z
echo($vpt=$vpt,$vpr=$vpr,$vpd=$vpd); //,$vpf=$vpf); // object of interest
cube([75,20,50]); // oriented message
translate([25,25,100])
rotate([$vpr[0],$vpr[1],$vpr[2]])
text(str("$vpr=",$vpr[2]),size=10);
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
- on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
Caddiy wrote
> So it's got some built-in errors, right?
Not sure what you mean?
Every so often emails from the forum lose line breaks, I don't know where it
happens.
e.g. This is what I got:
> // turn on animation
> $vpr = [$vpr[0], 0, $t * 360]; // animated rotate around Z
> echo($vpt=$vpt,$vpr=$vpr,$vpd=$vpd); //,$vpf=$vpf); // object of interest
> cube([75,20,50]); // oriented message
> translate([25,25,100])
> rotate([$vpr[0],$vpr[1],$vpr[2]])
> text(str("$vpr=",$vpr[2]),size=10);
-----
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
M
MichaelAtOz
Tue, Oct 20, 2020 11:00 PM
...an of course, that quote has different breaks...
I suspect it may be my email client, this is what I got.
-----Original Message-----
Sent: Wed, 21 Oct 2020 09:34
Subject: Re: [OpenSCAD] Another missing feature? (All I want for Xmas...)
So it's got some built-in errors, right?
Every so often emails from the forum lose line breaks, I don't know where it
$vpr = [$vpr[0], 0, $t * 360]; // animated rotate around Z
echo($vpt=$vpt,$vpr=$vpr,$vpd=$vpd); //,$vpf=$vpf); // object of interest
cube([75,20,50]); // oriented message
rotate([$vpr[0],$vpr[1],$vpr[2]])
text(str("$vpr=",$vpr[2]),size=10);
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
- on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the
extent possible under law, I have waived all copyright and related or neighbouring rights
to this work. Obviously inclusion of works of previous authors is not included in the
...an of course, that quote has different breaks...
I suspect it may be my email client, this is what I got.
> -----Original Message-----
> From: Discuss [mailto:discuss-bounces@lists.openscad.org] On Behalf Of MichaelAtOz
> Sent: Wed, 21 Oct 2020 09:34
> To: discuss@lists.openscad.org
> Subject: Re: [OpenSCAD] Another missing feature? (All I want for Xmas...)
>
> Caddiy wrote
> > So it's got some built-in errors, right?
>
> Not sure what you mean?
> Every so often emails from the forum lose line breaks, I don't know where it
> happens.
>
> e.g. This is what I got:
>
> > // turn on animation
> > $vpr = [$vpr[0], 0, $t * 360]; // animated rotate around Z
> > echo($vpt=$vpt,$vpr=$vpr,$vpd=$vpd); //,$vpf=$vpf); // object of interest
> > cube([75,20,50]); // oriented message
> > translate([25,25,100])
> > rotate([$vpr[0],$vpr[1],$vpr[2]])
> > text(str("$vpr=",$vpr[2]),size=10);
>
>
>
>
>
> -----
> OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
>
> * on the Forum, click on my MichaelAtOz label, there is a link to email me.
>
> Unless specifically shown otherwise above, my contribution is in the Public Domain; to the
> extent possible under law, I have waived all copyright and related or neighbouring rights
> to this work. Obviously inclusion of works of previous authors is not included in the
> above.
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
This email has been checked for viruses by AVG.
https://www.avg.com
C
Caddiy
Wed, Oct 21, 2020 3:23 AM
/...an of course, that quote has different breaks...
I suspect it may be my email client, this is what I got./
There seems to be something wrong with your code and I don't think it's the
line breaks:
http://forum.openscad.org/file/t2925/frame00000.gif
--
Sent from: http://forum.openscad.org/
/...an of course, that quote has different breaks...
I suspect it may be my email client, this is what I got./
There seems to be something wrong with your code and I don't think it's the
line breaks:
<http://forum.openscad.org/file/t2925/frame00000.gif>
--
Sent from: http://forum.openscad.org/
M
MichaelAtOz
Wed, Oct 21, 2020 4:33 AM
I said "Here is one for inspiration to get you started."
You will need to use $vpt and/or $vpd to position it wherever you want it.
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
- on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
I said "Here is one for inspiration to get you started."
You will need to use $vpt and/or $vpd to position it wherever you want it.
-----
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
NH
nop head
Wed, Oct 21, 2020 5:39 AM
Yes $vpt, $vpr and $vpd tell you where the camera is and which direction it
is looking, so you need to position your fixed text relative to the camera
position, so that no matter where the camera is looking it always appears
the same.
On Wed, 21 Oct 2020 at 05:34, MichaelAtOz oz.at.michael@gmail.com wrote:
I said "Here is one for inspiration to get you started."
You will need to use $vpt and/or $vpd to position it wherever you want it.
OpenSCAD Admin - email* me if you need anything, or if I've done
something stupid...
- on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the
Public Domain; to the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. Obviously
inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Yes $vpt, $vpr and $vpd tell you where the camera is and which direction it
is looking, so you need to position your fixed text relative to the camera
position, so that no matter where the camera is looking it always appears
the same.
On Wed, 21 Oct 2020 at 05:34, MichaelAtOz <oz.at.michael@gmail.com> wrote:
> I said "Here is one for inspiration to get you started."
> You will need to use $vpt and/or $vpd to position it wherever you want it.
>
>
>
> -----
> OpenSCAD Admin - email* me if you need anything, or if I've done
> something stupid...
>
> * on the Forum, click on my MichaelAtOz label, there is a link to email me.
>
> Unless specifically shown otherwise above, my contribution is in the
> Public Domain; to the extent possible under law, I have waived all
> copyright and related or neighbouring rights to this work. Obviously
> inclusion of works of previous authors is not included in the above.
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
C
Caddiy
Wed, Oct 21, 2020 9:04 PM
/I said "Here is one for inspiration to get you started."
You will need to use $vpt and/or $vpd to position it wherever you want it.
/
-
"INSpiration" would appear to be something of a euphemism. I think
"DESparation" comes closer as a description of my current state of mind with
regard to the subject of this discussion.
-
"check the forum to get the right one." If you can't get "the right one",
how do you expect me to find it?
-
What is this...
// turn on animation
$vpr = [$vpr[0], 0, $t * 360]; // animated rotate around Z
/I said "Here is one for inspiration to get you started."
You will need to use $vpt and/or $vpd to position it wherever you want it.
/
- "INSpiration" would appear to be something of a euphemism. I think
"DESparation" comes closer as a description of my current state of mind with
regard to the subject of this discussion.
- "check the forum to get the right one." If you can't get "the right one",
how do you expect me to find it?
- What is this...
> // turn on animation
> $vpr = [$vpr[0], 0, $t * 360]; // animated rotate around Z
...doing in your code? I don't want everything going round and round in
circles.
--
Sent from: http://forum.openscad.org/
M
MichaelAtOz
Wed, Oct 21, 2020 10:09 PM
- "check the forum to get the right one." If you can't get "the right
one",
how do you expect me to find it?
// turn on animation
$vpr = [$vpr[0], 0, $t * 360]; // animated rotate around Z
...doing in your code? I don't want everything going round and round in
circles.
It is an example animated object.
In the file above, line 9+ is the bit which makes the text face forward.
OpenSCAD is a program language.
You need to add $vpr/$vpd to position your message where you want it.
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
- on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
Caddiy wrote
> - "check the forum to get the right one." If you can't get "the right
> one",
> how do you expect me to find it?
This is the forum, my message above has the code, the code in the email was
corrupted.
Anyway, I have reformatted it here: animate-directed-message.scad
<http://forum.openscad.org/file/t359/animate-directed-message.scad>
It is an example.
> - What is this...
>
>> // turn on animation
>> $vpr = [$vpr[0], 0, $t * 360]; // animated rotate around Z
>
> ...doing in your code? I don't want everything going round and round in
> circles.
It is an example animated object.
In the file above, line 9+ is the bit which makes the text face forward.
OpenSCAD is a program language.
You need to add $vpr/$vpd to position your message where you want it.
-----
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
C
Caddiy
Wed, Oct 21, 2020 11:03 PM
/Yes $vpt, $vpr and $vpd tell you where the camera is and which direction it
is looking, so you need to position your fixed text relative to the camera
position, so that no matter where the camera is looking it always appears
the same./
Right, that's exactly what I want.
So it's just a matter of adding a bit to those x,y,z coordinates or what?
What is the syntax for this?
No mention of Edit/Copy viewport translation, rotation, distance. Are these
not relevant here?
I know the commands for $vpt and $vpr are translate and rotate. What is the
command for the variable, $vpd?
The User Manual says "$vpf shows the FOV of the view". What's that and where
is it "shown"? Do I need it?
I'm sorry to have to bother the forum with this elementary stuff, but it is
unfortunately not in the User Manual.
--
Sent from: http://forum.openscad.org/
/Yes $vpt, $vpr and $vpd tell you where the camera is and which direction it
is looking, so you need to position your fixed text relative to the camera
position, so that no matter where the camera is looking it always appears
the same./
Right, that's exactly what I want.
So it's just a matter of adding a bit to those x,y,z coordinates or what?
What is the syntax for this?
No mention of Edit/Copy viewport translation, rotation, distance. Are these
not relevant here?
I know the commands for $vpt and $vpr are translate and rotate. What is the
command for the variable, $vpd?
The User Manual says "$vpf shows the FOV of the view". What's that and where
is it "shown"? Do I need it?
I'm sorry to have to bother the forum with this elementary stuff, but it is
unfortunately not in the User Manual.
--
Sent from: http://forum.openscad.org/
NH
nop head
Thu, Oct 22, 2020 6:51 AM
You need to translate and rotate your message text to be in a position
relative to the camera using translate() and rotate() with values derived
from $vpr, $vpt, $vpd.
$fpd is the distance from the camera to the viewport as shown in the
distance figure at the bottom of the screen and changes with the zoom level.
$vpf is new and is available in the snapshots. It is the field of view of
the camera and again appears at the bottom of the screen if you have a
recent snapshot. On older versions it is fixed at 22.5 degrees and, unless
you assign a value to it, it will be 22.5 because the GUI has no way of
changing it. You would need to use it to find where the edge of the view
is, I think. I have just realised you would also need to know the window
size. Which isn't available in a variable. So I think you would maximize
the window and read the figure at the bottom and paste it into your code
which would then only work at the same window size.
You don't need the copy menu options as these are just the same values that
appear in $vpr, etc, You can paste them into code when you want to select a
particular camera setup by assigning to $vpr, $vpt, etc, or you can use
them on the command line to specify the camera position.
So you know the view is rotated by $vpr, translated by $vpt relative to the
viewport origin and the camera is then set back by $vpt and has a field of
view of $vpf. You have to work out how to position, rotate and scale your
text so it appears at the edge of the FOV of the camera.
This nearly works for me but I don't know why I needed -350 or why X is a
little bit off the screen. I am not quite sure how OpenSCAD units relate to
pixels on the screen. Changing the window y dimension zooms the image to
fit but changing x just clips it. Perhaps somebody else can finish it off
as I have other things to do today.
window = [894, 422]; // Copied from the bottom of the GUI
translate($vpt)
rotate($vpr)
scale($vpd / window.y)
translate([window.x, -350] / 2 * tan($vpf))
linear_extrude(0.1)
text("hello", valign = "baseline", halign = "right");
[image: image.png]
On Thu, 22 Oct 2020 at 00:04, Caddiy mikeonenine@web.de wrote:
/Yes $vpt, $vpr and $vpd tell you where the camera is and which direction
it
is looking, so you need to position your fixed text relative to the camera
position, so that no matter where the camera is looking it always appears
the same./
Right, that's exactly what I want.
So it's just a matter of adding a bit to those x,y,z coordinates or what?
What is the syntax for this?
No mention of Edit/Copy viewport translation, rotation, distance. Are these
not relevant here?
I know the commands for $vpt and $vpr are translate and rotate. What is the
command for the variable, $vpd?
The User Manual says "$vpf shows the FOV of the view". What's that and
where
is it "shown"? Do I need it?
I'm sorry to have to bother the forum with this elementary stuff, but it is
unfortunately not in the User Manual.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
You need to translate and rotate your message text to be in a position
relative to the camera using translate() and rotate() with values derived
from $vpr, $vpt, $vpd.
$fpd is the distance from the camera to the viewport as shown in the
distance figure at the bottom of the screen and changes with the zoom level.
$vpf is new and is available in the snapshots. It is the field of view of
the camera and again appears at the bottom of the screen if you have a
recent snapshot. On older versions it is fixed at 22.5 degrees and, unless
you assign a value to it, it will be 22.5 because the GUI has no way of
changing it. You would need to use it to find where the edge of the view
is, I think. I have just realised you would also need to know the window
size. Which isn't available in a variable. So I think you would maximize
the window and read the figure at the bottom and paste it into your code
which would then only work at the same window size.
You don't need the copy menu options as these are just the same values that
appear in $vpr, etc, You can paste them into code when you want to select a
particular camera setup by assigning to $vpr, $vpt, etc, or you can use
them on the command line to specify the camera position.
So you know the view is rotated by $vpr, translated by $vpt relative to the
viewport origin and the camera is then set back by $vpt and has a field of
view of $vpf. You have to work out how to position, rotate and scale your
text so it appears at the edge of the FOV of the camera.
This nearly works for me but I don't know why I needed -350 or why X is a
little bit off the screen. I am not quite sure how OpenSCAD units relate to
pixels on the screen. Changing the window y dimension zooms the image to
fit but changing x just clips it. Perhaps somebody else can finish it off
as I have other things to do today.
window = [894, 422]; // Copied from the bottom of the GUI
translate($vpt)
rotate($vpr)
scale($vpd / window.y)
translate([window.x, -350] / 2 * tan($vpf))
linear_extrude(0.1)
text("hello", valign = "baseline", halign = "right");
[image: image.png]
On Thu, 22 Oct 2020 at 00:04, Caddiy <mikeonenine@web.de> wrote:
>
>
> /Yes $vpt, $vpr and $vpd tell you where the camera is and which direction
> it
> is looking, so you need to position your fixed text relative to the camera
> position, so that no matter where the camera is looking it always appears
> the same./
>
>
>
> Right, that's exactly what I want.
>
> So it's just a matter of adding a bit to those x,y,z coordinates or what?
>
> What is the syntax for this?
>
> No mention of Edit/Copy viewport translation, rotation, distance. Are these
> not relevant here?
>
> I know the commands for $vpt and $vpr are translate and rotate. What is the
> command for the variable, $vpd?
>
> The User Manual says "$vpf shows the FOV of the view". What's that and
> where
> is it "shown"? Do I need it?
>
> I'm sorry to have to bother the forum with this elementary stuff, but it is
> unfortunately not in the User Manual.
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
C
Caddiy
Thu, Oct 22, 2020 11:03 PM
/So you know the view is rotated by $vpr, translated by $vpt relative to the
viewport origin and the camera is then set back by $vpt and has a field of
view of $vpf. You have to work out how to position, rotate and scale your
text so it appears at the edge of the FOV of the camera.
/
Thanks for your explanations.
$vpd differs from $vpt and $vpr in that it's a single value as opposed to a
coordinate, and with animation or preview, it overrides the mouse wheel, as
might be expected. It also does not take a command word and uses no
brackets, but the $vpd=value command does need to end with a semicolon. It
also needs to be placed outside the string of commands for any object. In
particular, though, unlike the others, $vpd seems to have a global effect
and cannot be restricted to a particular object.
Or is there a way to apply $vpd to one object only, e.g. text such that it
stays in the same position and size relative to the viewport instead of
relative to the object, while independently zooming in and out on the object
and moving it around?
The best solution would be an extra GUI layer for text with some elementary
word processing functions. However, there does not seem to be much demand
for text in a fixed position in the viewport. People seem to have been quite
happy without it so far.
After deleting the 2/3 of the original script that was redundant or
otherwise superfluous and only served to confuse a beginner without any
programming background, I managed to get to a useful core that I could build
upon. For my immediate needs I have also incorporated a fudge that magnifies
(or reduces) the object without affecting the text. It saves a lot of
chasing skewed text floating around in virtual space. If there is sufficient
interest, I could publish the fixed text code here.
--
Sent from: http://forum.openscad.org/
/So you know the view is rotated by $vpr, translated by $vpt relative to the
viewport origin and the camera is then set back by $vpt and has a field of
view of $vpf. You have to work out how to position, rotate and scale your
text so it appears at the edge of the FOV of the camera.
/
Thanks for your explanations.
$vpd differs from $vpt and $vpr in that it's a single value as opposed to a
coordinate, and with animation or preview, it overrides the mouse wheel, as
might be expected. It also does not take a command word and uses no
brackets, but the $vpd=value command does need to end with a semicolon. It
also needs to be placed outside the string of commands for any object. In
particular, though, unlike the others, $vpd seems to have a global effect
and cannot be restricted to a particular object.
Or is there a way to apply $vpd to one object only, e.g. text such that it
stays in the same position and size relative to the viewport instead of
relative to the object, while independently zooming in and out on the object
and moving it around?
The best solution would be an extra GUI layer for text with some elementary
word processing functions. However, there does not seem to be much demand
for text in a fixed position in the viewport. People seem to have been quite
happy without it so far.
After deleting the 2/3 of the original script that was redundant or
otherwise superfluous and only served to confuse a beginner without any
programming background, I managed to get to a useful core that I could build
upon. For my immediate needs I have also incorporated a fudge that magnifies
(or reduces) the object without affecting the text. It saves a lot of
chasing skewed text floating around in virtual space. If there is sufficient
interest, I could publish the fixed text code here.
--
Sent from: http://forum.openscad.org/
NH
nop head
Sat, Oct 24, 2020 9:15 AM
$vpr, $vpd, $vpt are not operators. They are simply variables that reflect
the current camera settings which are changed by the GUI pan, rotate and
zoom.
You use translate, rotate and scale on your text to place it in a fixed
position relative to the camera using information about the camera in $vpr,
$vpd and $vpt. The only difference with $vpd is it is a scalar distance but
the viewport rotation and translation variables are 3 element vectors.
The example I posted shows how to place text in the bottom right of a scene
but isn't quite right in determining the precise offset needed depending on
the screen width and height in pixels. It does get it the right size and
orientation and roughly in the bottom right. You can see in the picture I
posted it says Hell instead of Hello.
I will try and improve it later.
On Fri, 23 Oct 2020 at 00:04, Caddiy mikeonenine@web.de wrote:
/So you know the view is rotated by $vpr, translated by $vpt relative to
the
viewport origin and the camera is then set back by $vpt and has a field of
view of $vpf. You have to work out how to position, rotate and scale your
text so it appears at the edge of the FOV of the camera.
/
Thanks for your explanations.
$vpd differs from $vpt and $vpr in that it's a single value as opposed to
a
coordinate, and with animation or preview, it overrides the mouse wheel, as
might be expected. It also does not take a command word and uses no
brackets, but the $vpd=value command does need to end with a semicolon. It
also needs to be placed outside the string of commands for any object. In
particular, though, unlike the others, $vpd seems to have a global effect
and cannot be restricted to a particular object.
Or is there a way to apply $vpd to one object only, e.g. text such that it
stays in the same position and size relative to the viewport instead of
relative to the object, while independently zooming in and out on the
object
and moving it around?
The best solution would be an extra GUI layer for text with some elementary
word processing functions. However, there does not seem to be much demand
for text in a fixed position in the viewport. People seem to have been
quite
happy without it so far.
After deleting the 2/3 of the original script that was redundant or
otherwise superfluous and only served to confuse a beginner without any
programming background, I managed to get to a useful core that I could
build
upon. For my immediate needs I have also incorporated a fudge that
magnifies
(or reduces) the object without affecting the text. It saves a lot of
chasing skewed text floating around in virtual space. If there is
sufficient
interest, I could publish the fixed text code here.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
$vpr, $vpd, $vpt are not operators. They are simply variables that reflect
the current camera settings which are changed by the GUI pan, rotate and
zoom.
You use translate, rotate and scale on your text to place it in a fixed
position relative to the camera using information about the camera in $vpr,
$vpd and $vpt. The only difference with $vpd is it is a scalar distance but
the viewport rotation and translation variables are 3 element vectors.
The example I posted shows how to place text in the bottom right of a scene
but isn't quite right in determining the precise offset needed depending on
the screen width and height in pixels. It does get it the right size and
orientation and roughly in the bottom right. You can see in the picture I
posted it says Hell instead of Hello.
I will try and improve it later.
On Fri, 23 Oct 2020 at 00:04, Caddiy <mikeonenine@web.de> wrote:
>
>
> /So you know the view is rotated by $vpr, translated by $vpt relative to
> the
> viewport origin and the camera is then set back by $vpt and has a field of
> view of $vpf. You have to work out how to position, rotate and scale your
> text so it appears at the edge of the FOV of the camera.
> /
>
> Thanks for your explanations.
>
> $vpd differs from $vpt and $vpr in that it's a single value as opposed to
> a
> coordinate, and with animation or preview, it overrides the mouse wheel, as
> might be expected. It also does not take a command word and uses no
> brackets, but the $vpd=value command does need to end with a semicolon. It
> also needs to be placed outside the string of commands for any object. In
> particular, though, unlike the others, $vpd seems to have a global effect
> and cannot be restricted to a particular object.
>
> Or is there a way to apply $vpd to one object only, e.g. text such that it
> stays in the same position and size relative to the viewport instead of
> relative to the object, while independently zooming in and out on the
> object
> and moving it around?
>
> The best solution would be an extra GUI layer for text with some elementary
> word processing functions. However, there does not seem to be much demand
> for text in a fixed position in the viewport. People seem to have been
> quite
> happy without it so far.
>
> After deleting the 2/3 of the original script that was redundant or
> otherwise superfluous and only served to confuse a beginner without any
> programming background, I managed to get to a useful core that I could
> build
> upon. For my immediate needs I have also incorporated a fudge that
> magnifies
> (or reduces) the object without affecting the text. It saves a lot of
> chasing skewed text floating around in virtual space. If there is
> sufficient
> interest, I could publish the fixed text code here.
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
C
Caddiy
Sun, Oct 25, 2020 2:34 AM
/but isn't quite right in determining the precise offset needed depending on
the screen width and height in pixels. It does get it the right size and
orientation and roughly in the bottom right. You can see in the picture I
posted it says Hell instead of Hello./
I cannot assess your script, I haven't got that far. But are you sure the
values of $vp* are in any way related to the number of pixels on your
computer monitor? It doesn't strike me as a particularly promising approach.
Is there a way to apply $vpd to a single object as can be done with $vpr&t,
as opposed to the whole scene?
--
Sent from: http://forum.openscad.org/
/but isn't quite right in determining the precise offset needed depending on
the screen width and height in pixels. It does get it the right size and
orientation and roughly in the bottom right. You can see in the picture I
posted it says Hell instead of Hello./
I cannot assess your script, I haven't got that far. But are you sure the
values of $vp* are in any way related to the number of pixels on your
computer monitor? It doesn't strike me as a particularly promising approach.
Is there a way to apply $vpd to a single object as can be done with $vpr&t,
as opposed to the whole scene?
--
Sent from: http://forum.openscad.org/
NH
nop head
Sun, Oct 25, 2020 5:40 AM
Why can't you see my script? It was in my email reply to the group.
You can also see it in the forum here:
http://forum.openscad.org/Another-missing-feature-All-I-want-for-Xmas-tp30314p30351.html
You can use $vpd with scale() to set the size of the text as I did in my
example.
You have to enter the window size in pixels at the start of my screen,
copied from the GUI status line. I attempt to relate them to the camera
with $vpf but my calculation is not quite right.
On Sun, 25 Oct 2020 at 02:35, Caddiy mikeonenine@web.de wrote:
/but isn't quite right in determining the precise offset needed depending
on
the screen width and height in pixels. It does get it the right size and
orientation and roughly in the bottom right. You can see in the picture I
posted it says Hell instead of Hello./
I cannot assess your script, I haven't got that far. But are you sure the
values of $vp* are in any way related to the number of pixels on your
computer monitor? It doesn't strike me as a particularly promising
approach.
Is there a way to apply $vpd to a single object as can be done with $vpr&t,
as opposed to the whole scene?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Why can't you see my script? It was in my email reply to the group.
You can also see it in the forum here:
http://forum.openscad.org/Another-missing-feature-All-I-want-for-Xmas-tp30314p30351.html
You can use $vpd with scale() to set the size of the text as I did in my
example.
You have to enter the window size in pixels at the start of my screen,
copied from the GUI status line. I attempt to relate them to the camera
with $vpf but my calculation is not quite right.
On Sun, 25 Oct 2020 at 02:35, Caddiy <mikeonenine@web.de> wrote:
>
>
> /but isn't quite right in determining the precise offset needed depending
> on
> the screen width and height in pixels. It does get it the right size and
> orientation and roughly in the bottom right. You can see in the picture I
> posted it says Hell instead of Hello./
>
>
> I cannot assess your script, I haven't got that far. But are you sure the
> values of $vp* are in any way related to the number of pixels on your
> computer monitor? It doesn't strike me as a particularly promising
> approach.
>
> Is there a way to apply $vpd to a single object as can be done with $vpr&t,
> as opposed to the whole scene?
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
NH
nop head
Sun, Oct 25, 2020 6:05 AM
This is a more correct version but it always looks like the text is center
justified but it isn't. Not sure what I got wrong.
window = [776, 362]; // Copied from the bottom of the GUI
sphere(20);
translate($vpt)
rotate($vpr)
scale($vpd / window.y)
translate([window.x, -window.y] / 2 * tan($vpf))
linear_extrude(0.001)
text("hello", valign = "baseline", halign = "right");
On Sun, 25 Oct 2020 at 05:40, nop head nop.head@gmail.com wrote:
Why can't you see my script? It was in my email reply to the group.
You can also see it in the forum here:
http://forum.openscad.org/Another-missing-feature-All-I-want-for-Xmas-tp30314p30351.html
You can use $vpd with scale() to set the size of the text as I did in my
example.
You have to enter the window size in pixels at the start of my screen,
copied from the GUI status line. I attempt to relate them to the camera
with $vpf but my calculation is not quite right.
On Sun, 25 Oct 2020 at 02:35, Caddiy mikeonenine@web.de wrote:
/but isn't quite right in determining the precise offset needed depending
on
the screen width and height in pixels. It does get it the right size and
orientation and roughly in the bottom right. You can see in the picture I
posted it says Hell instead of Hello./
I cannot assess your script, I haven't got that far. But are you sure the
values of $vp* are in any way related to the number of pixels on your
computer monitor? It doesn't strike me as a particularly promising
approach.
Is there a way to apply $vpd to a single object as can be done with
$vpr&t,
as opposed to the whole scene?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
This is a more correct version but it always looks like the text is center
justified but it isn't. Not sure what I got wrong.
window = [776, 362]; // Copied from the bottom of the GUI
sphere(20);
translate($vpt)
rotate($vpr)
scale($vpd / window.y)
translate([window.x, -window.y] / 2 * tan($vpf))
linear_extrude(0.001)
text("hello", valign = "baseline", halign = "right");
On Sun, 25 Oct 2020 at 05:40, nop head <nop.head@gmail.com> wrote:
> Why can't you see my script? It was in my email reply to the group.
>
> You can also see it in the forum here:
> http://forum.openscad.org/Another-missing-feature-All-I-want-for-Xmas-tp30314p30351.html
>
> You can use $vpd with scale() to set the size of the text as I did in my
> example.
>
> You have to enter the window size in pixels at the start of my screen,
> copied from the GUI status line. I attempt to relate them to the camera
> with $vpf but my calculation is not quite right.
>
> On Sun, 25 Oct 2020 at 02:35, Caddiy <mikeonenine@web.de> wrote:
>
>>
>>
>> /but isn't quite right in determining the precise offset needed depending
>> on
>> the screen width and height in pixels. It does get it the right size and
>> orientation and roughly in the bottom right. You can see in the picture I
>> posted it says Hell instead of Hello./
>>
>>
>> I cannot assess your script, I haven't got that far. But are you sure the
>> values of $vp* are in any way related to the number of pixels on your
>> computer monitor? It doesn't strike me as a particularly promising
>> approach.
>>
>> Is there a way to apply $vpd to a single object as can be done with
>> $vpr&t,
>> as opposed to the whole scene?
>>
>>
>>
>> --
>> Sent from: http://forum.openscad.org/
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> Discuss@lists.openscad.org
>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>>
>
D
dpa
Sun, Oct 25, 2020 9:41 AM
Why can't you see my script? It was in my email reply to the group.
I don't know if it's the case here, but I'll take Nop's question as an
opportunity to point out that I actually noticed that I don't receive all
the posts as email! It seems to be random.
So if you really want to be sure that you can read all the posts you have
to go to http://forum.openscad.org/!
Strange but is like this
Am So., 25. Okt. 2020 um 06:41 Uhr schrieb nop head <nop.head@gmail.com>:
> Why can't you see my script? It was in my email reply to the group.
>
I don't know if it's the case here, but I'll take Nop's question as an
opportunity to point out that I actually noticed that I don't receive all
the posts as email! It seems to be random.
So if you really want to be sure that you can read all the posts you have
to go to http://forum.openscad.org/!
Strange but is like this
NH
nop head
Sun, Oct 25, 2020 10:20 AM
OK this is a version that works.
window = [737, 888]; // Copied from the bottom of the GUI
sphere(20);
translate($vpt)
rotate($vpr)
translate([$vpd * window.x / window.y, -$vpd] * tan($vpf / 2))
scale($vpd / window.y)
linear_extrude(0.001)
text("hello", valign = "baseline", halign = "right");
On Sun, 25 Oct 2020 at 06:05, nop head nop.head@gmail.com wrote:
This is a more correct version but it always looks like the text is center
justified but it isn't. Not sure what I got wrong.
window = [776, 362]; // Copied from the bottom of the GUI
sphere(20);
translate($vpt)
rotate($vpr)
scale($vpd / window.y)
translate([window.x, -window.y] / 2 * tan($vpf))
linear_extrude(0.001)
text("hello", valign = "baseline", halign = "right");
On Sun, 25 Oct 2020 at 05:40, nop head nop.head@gmail.com wrote:
Why can't you see my script? It was in my email reply to the group.
You can also see it in the forum here:
http://forum.openscad.org/Another-missing-feature-All-I-want-for-Xmas-tp30314p30351.html
You can use $vpd with scale() to set the size of the text as I did in my
example.
You have to enter the window size in pixels at the start of my screen,
copied from the GUI status line. I attempt to relate them to the camera
with $vpf but my calculation is not quite right.
On Sun, 25 Oct 2020 at 02:35, Caddiy mikeonenine@web.de wrote:
/but isn't quite right in determining the precise offset needed
depending on
the screen width and height in pixels. It does get it the right size and
orientation and roughly in the bottom right. You can see in the picture I
posted it says Hell instead of Hello./
I cannot assess your script, I haven't got that far. But are you sure the
values of $vp* are in any way related to the number of pixels on your
computer monitor? It doesn't strike me as a particularly promising
approach.
Is there a way to apply $vpd to a single object as can be done with
$vpr&t,
as opposed to the whole scene?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OK this is a version that works.
window = [737, 888]; // Copied from the bottom of the GUI
sphere(20);
translate($vpt)
rotate($vpr)
translate([$vpd * window.x / window.y, -$vpd] * tan($vpf / 2))
scale($vpd / window.y)
linear_extrude(0.001)
text("hello", valign = "baseline", halign = "right");
On Sun, 25 Oct 2020 at 06:05, nop head <nop.head@gmail.com> wrote:
> This is a more correct version but it always looks like the text is center
> justified but it isn't. Not sure what I got wrong.
>
> window = [776, 362]; // Copied from the bottom of the GUI
>
> sphere(20);
>
> translate($vpt)
> rotate($vpr)
> scale($vpd / window.y)
> translate([window.x, -window.y] / 2 * tan($vpf))
> linear_extrude(0.001)
> text("hello", valign = "baseline", halign = "right");
>
>
>
> On Sun, 25 Oct 2020 at 05:40, nop head <nop.head@gmail.com> wrote:
>
>> Why can't you see my script? It was in my email reply to the group.
>>
>> You can also see it in the forum here:
>> http://forum.openscad.org/Another-missing-feature-All-I-want-for-Xmas-tp30314p30351.html
>>
>> You can use $vpd with scale() to set the size of the text as I did in my
>> example.
>>
>> You have to enter the window size in pixels at the start of my screen,
>> copied from the GUI status line. I attempt to relate them to the camera
>> with $vpf but my calculation is not quite right.
>>
>> On Sun, 25 Oct 2020 at 02:35, Caddiy <mikeonenine@web.de> wrote:
>>
>>>
>>>
>>> /but isn't quite right in determining the precise offset needed
>>> depending on
>>> the screen width and height in pixels. It does get it the right size and
>>> orientation and roughly in the bottom right. You can see in the picture I
>>> posted it says Hell instead of Hello./
>>>
>>>
>>> I cannot assess your script, I haven't got that far. But are you sure the
>>> values of $vp* are in any way related to the number of pixels on your
>>> computer monitor? It doesn't strike me as a particularly promising
>>> approach.
>>>
>>> Is there a way to apply $vpd to a single object as can be done with
>>> $vpr&t,
>>> as opposed to the whole scene?
>>>
>>>
>>>
>>> --
>>> Sent from: http://forum.openscad.org/
>>>
>>> _______________________________________________
>>> OpenSCAD mailing list
>>> Discuss@lists.openscad.org
>>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>>>
>>
NH
nop head
Sun, Oct 25, 2020 10:29 AM
Slightly more concise:
window = [737, 888]; // Copied from the bottom of the GUI
sphere(20);
translate($vpt)
rotate($vpr)
translate([window.x / window.y, -1] * $vpd * tan($vpf / 2))
scale($vpd / window.y)
linear_extrude(0.001)
text("hello", valign = "baseline", halign = "right");
The window pixel dimensions are needed for two reasons. 1) to get the
correct x offset that depends on the aspect ratio and 2) to scale the text
if you don't want its size to change when the window is resized. So we need
yet another $ variable, $vpw to be the window size in pixels.
On Sun, 25 Oct 2020 at 10:20, nop head nop.head@gmail.com wrote:
OK this is a version that works.
window = [737, 888]; // Copied from the bottom of the GUI
sphere(20);
translate($vpt)
rotate($vpr)
translate([$vpd * window.x / window.y, -$vpd] * tan($vpf / 2))
scale($vpd / window.y)
linear_extrude(0.001)
text("hello", valign = "baseline", halign = "right");
On Sun, 25 Oct 2020 at 06:05, nop head nop.head@gmail.com wrote:
This is a more correct version but it always looks like the text is
center justified but it isn't. Not sure what I got wrong.
window = [776, 362]; // Copied from the bottom of the GUI
sphere(20);
translate($vpt)
rotate($vpr)
scale($vpd / window.y)
translate([window.x, -window.y] / 2 * tan($vpf))
linear_extrude(0.001)
text("hello", valign = "baseline", halign = "right");
On Sun, 25 Oct 2020 at 05:40, nop head nop.head@gmail.com wrote:
Why can't you see my script? It was in my email reply to the group.
You can also see it in the forum here:
http://forum.openscad.org/Another-missing-feature-All-I-want-for-Xmas-tp30314p30351.html
You can use $vpd with scale() to set the size of the text as I did in my
example.
You have to enter the window size in pixels at the start of my screen,
copied from the GUI status line. I attempt to relate them to the camera
with $vpf but my calculation is not quite right.
On Sun, 25 Oct 2020 at 02:35, Caddiy mikeonenine@web.de wrote:
/but isn't quite right in determining the precise offset needed
depending on
the screen width and height in pixels. It does get it the right size and
orientation and roughly in the bottom right. You can see in the picture
I
posted it says Hell instead of Hello./
I cannot assess your script, I haven't got that far. But are you sure
the
values of $vp* are in any way related to the number of pixels on your
computer monitor? It doesn't strike me as a particularly promising
approach.
Is there a way to apply $vpd to a single object as can be done with
$vpr&t,
as opposed to the whole scene?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Slightly more concise:
window = [737, 888]; // Copied from the bottom of the GUI
sphere(20);
translate($vpt)
rotate($vpr)
translate([window.x / window.y, -1] * $vpd * tan($vpf / 2))
scale($vpd / window.y)
linear_extrude(0.001)
text("hello", valign = "baseline", halign = "right");
The window pixel dimensions are needed for two reasons. 1) to get the
correct x offset that depends on the aspect ratio and 2) to scale the text
if you don't want its size to change when the window is resized. So we need
yet another $ variable, $vpw to be the window size in pixels.
On Sun, 25 Oct 2020 at 10:20, nop head <nop.head@gmail.com> wrote:
> OK this is a version that works.
>
> window = [737, 888]; // Copied from the bottom of the GUI
>
> sphere(20);
>
> translate($vpt)
> rotate($vpr)
> translate([$vpd * window.x / window.y, -$vpd] * tan($vpf / 2))
> scale($vpd / window.y)
> linear_extrude(0.001)
> text("hello", valign = "baseline", halign = "right");
>
> On Sun, 25 Oct 2020 at 06:05, nop head <nop.head@gmail.com> wrote:
>
>> This is a more correct version but it always looks like the text is
>> center justified but it isn't. Not sure what I got wrong.
>>
>> window = [776, 362]; // Copied from the bottom of the GUI
>>
>> sphere(20);
>>
>> translate($vpt)
>> rotate($vpr)
>> scale($vpd / window.y)
>> translate([window.x, -window.y] / 2 * tan($vpf))
>> linear_extrude(0.001)
>> text("hello", valign = "baseline", halign = "right");
>>
>>
>>
>> On Sun, 25 Oct 2020 at 05:40, nop head <nop.head@gmail.com> wrote:
>>
>>> Why can't you see my script? It was in my email reply to the group.
>>>
>>> You can also see it in the forum here:
>>> http://forum.openscad.org/Another-missing-feature-All-I-want-for-Xmas-tp30314p30351.html
>>>
>>> You can use $vpd with scale() to set the size of the text as I did in my
>>> example.
>>>
>>> You have to enter the window size in pixels at the start of my screen,
>>> copied from the GUI status line. I attempt to relate them to the camera
>>> with $vpf but my calculation is not quite right.
>>>
>>> On Sun, 25 Oct 2020 at 02:35, Caddiy <mikeonenine@web.de> wrote:
>>>
>>>>
>>>>
>>>> /but isn't quite right in determining the precise offset needed
>>>> depending on
>>>> the screen width and height in pixels. It does get it the right size and
>>>> orientation and roughly in the bottom right. You can see in the picture
>>>> I
>>>> posted it says Hell instead of Hello./
>>>>
>>>>
>>>> I cannot assess your script, I haven't got that far. But are you sure
>>>> the
>>>> values of $vp* are in any way related to the number of pixels on your
>>>> computer monitor? It doesn't strike me as a particularly promising
>>>> approach.
>>>>
>>>> Is there a way to apply $vpd to a single object as can be done with
>>>> $vpr&t,
>>>> as opposed to the whole scene?
>>>>
>>>>
>>>>
>>>> --
>>>> Sent from: http://forum.openscad.org/
>>>>
>>>> _______________________________________________
>>>> OpenSCAD mailing list
>>>> Discuss@lists.openscad.org
>>>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>>>>
>>>
M
MichaelAtOz
Sun, Oct 25, 2020 12:34 PM
It was "I cannot assess your script, I haven't got that far."
I believe that is not Access, but comprehend.
Some internet providers are less friendly to mailing-lists.
You can also get a Digest semi-daily too, which should have all the posts.
See http://lists.openscad.org/mailman/options/discuss_lists.openscad.org
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
- on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
dpa wrote
> Strange but is like this
It was "I cannot assess your script, I haven't got that far."
I believe that is not Access, but comprehend.
Some internet providers are less friendly to mailing-lists.
You can also get a Digest semi-daily too, which should have all the posts.
See http://lists.openscad.org/mailman/options/discuss_lists.openscad.org
-----
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
--
Sent from: http://forum.openscad.org/
C
Caddiy
Sun, Oct 25, 2020 6:20 PM
dpa wrote
It was "I cannot assess your script, I haven't got that far."
I believe that is not Access, but comprehend.
That is correct. Thank you. A lot of the stuff here is over my head.
But it was originally from Nophead, not dpa.
--
Sent from: http://forum.openscad.org/
dpa wrote
It was "I cannot assess your script, I haven't got that far."
I believe that is not Access, but comprehend.
That is correct. Thank you. A lot of the stuff here is over my head.
But it was originally from Nophead, not dpa.
--
Sent from: http://forum.openscad.org/
C
Caddiy
Sun, Oct 25, 2020 6:27 PM
The above reply was to Michael@Oz, but for some reason it shows dpa instead.
--
Sent from: http://forum.openscad.org/
The above reply was to Michael@Oz, but for some reason it shows dpa instead.
--
Sent from: http://forum.openscad.org/
NH
nop head
Sun, Oct 25, 2020 6:30 PM
Does the latest code I posted work for you?
On Sun, 25 Oct 2020 at 18:28, Caddiy mikeonenine@web.de wrote:
Does the latest code I posted work for you?
On Sun, 25 Oct 2020 at 18:28, Caddiy <mikeonenine@web.de> wrote:
> The above reply was to Michael@Oz, but for some reason it shows dpa
> instead.
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
C
Caddiy
Sun, Oct 25, 2020 6:33 PM
Slightly more concise...
Looks interesting. Will try it out.
--
Sent from: http://forum.openscad.org/
Slightly more concise...
Looks interesting. Will try it out.
--
Sent from: http://forum.openscad.org/
C
Caddiy
Sun, Oct 25, 2020 7:33 PM
Does the latest code I posted work for you?
Not really. I tried the code "as is" and with my figures copied by hand from
the bottom of the GUI, as the variables do not seem to update themselves
with "preview" or "animation". For §vpf I just entered 22. The "hello" still
moves together with the sphere and does not stay in the corner. Have I
overlooked something?
The code with my figures:
window = [1029, 640]; // Copied from the bottom of the GUI
sphere(20);
translate(37,39,5)
rotate(100,0,325)
translate([1029 / 640, -1] * 293 * tan(22 / 2))
scale(293 / 640)
linear_extrude(0.001)
text("hello", valign = "baseline", halign = "right");
The window size of course depends on how much of the screen the editor
occupies - which is variable.
--
Sent from: http://forum.openscad.org/
Does the latest code I posted work for you?
Not really. I tried the code "as is" and with my figures copied by hand from
the bottom of the GUI, as the variables do not seem to update themselves
with "preview" or "animation". For §vpf I just entered 22. The "hello" still
moves together with the sphere and does not stay in the corner. Have I
overlooked something?
The code with my figures:
window = [1029, 640]; // Copied from the bottom of the GUI
sphere(20);
translate(37,39,5)
rotate(100,0,325)
translate([1029 / 640, -1] * 293 * tan(22 / 2))
scale(293 / 640)
linear_extrude(0.001)
text("hello", valign = "baseline", halign = "right");
The window size of course depends on how much of the screen the editor
occupies - which is variable.
--
Sent from: http://forum.openscad.org/
NH
nop head
Sun, Oct 25, 2020 7:44 PM
You should only fill in window size and leave the rest of the code using
$vpt, etc. If you haven't got $vpf use 22.5, not 22.
On Sun, 25 Oct 2020 at 19:34, Caddiy mikeonenine@web.de wrote:
Does the latest code I posted work for you?
Not really. I tried the code "as is" and with my figures copied by hand
from
the bottom of the GUI, as the variables do not seem to update themselves
with "preview" or "animation". For §vpf I just entered 22. The "hello"
still
moves together with the sphere and does not stay in the corner. Have I
overlooked something?
The code with my figures:
window = [1029, 640]; // Copied from the bottom of the GUI
sphere(20);
translate(37,39,5)
rotate(100,0,325)
translate([1029 / 640, -1] * 293 * tan(22 / 2))
scale(293 / 640)
linear_extrude(0.001)
text("hello", valign = "baseline", halign = "right");
The window size of course depends on how much of the screen the editor
occupies - which is variable.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
You should only fill in window size and leave the rest of the code using
$vpt, etc. If you haven't got $vpf use 22.5, not 22.
On Sun, 25 Oct 2020 at 19:34, Caddiy <mikeonenine@web.de> wrote:
>
> Does the latest code I posted work for you?
>
>
> Not really. I tried the code "as is" and with my figures copied by hand
> from
> the bottom of the GUI, as the variables do not seem to update themselves
> with "preview" or "animation". For §vpf I just entered 22. The "hello"
> still
> moves together with the sphere and does not stay in the corner. Have I
> overlooked something?
>
> The code with my figures:
>
> window = [1029, 640]; // Copied from the bottom of the GUI
>
> sphere(20);
>
> translate(37,39,5)
> rotate(100,0,325)
> translate([1029 / 640, -1] * 293 * tan(22 / 2))
> scale(293 / 640)
> linear_extrude(0.001)
> text("hello", valign = "baseline", halign = "right");
>
> The window size of course depends on how much of the screen the editor
> occupies - which is variable.
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
JB
Jordan Brown
Sun, Oct 25, 2020 8:00 PM
On 10/24/2020 7:34 PM, Caddiy wrote:
I cannot assess your script, I haven't got that far. But are you sure the
values of $vp* are in any way related to the number of pixels on your
computer monitor?
They are not, but it all ties together.
$vpt says where the camera is relative to the model.
$vpr says which direction the camera is pointing.
I'm not sure exactly what $vpd represents, but effectively it's a zoom
control. (It's referred to as "distance", but I don't understand
exactly how it relates to $vpt.)
Now put a frame between the camera and the model. That's your window.
What you see on your screen is what the camera can see through that frame.
Another way to look at it is to relate them to how you manually position
the window using the mouse. The left mouse button is tied to $vpr, the
right mouse button to $vpt, and the wheel to $vpd.
The variables can be used to let the program look at where you've
manually positioned the camera, or let the program set the location of
the camera.
Create a simple model. cube(10) is fine. Note that at the bottom of
the window there's a like that says
Viewport: translate = [ xxx yyy zzz ], rotate = [ xxx, yyy, zzz ],
distance = ddd (www x hhh)
Watch how those numbers change when you use the mouse to look around the
model. $vpt is the "translate" numbers, $vpr is the "rotate" numbers,
and $vpd is the "distance" number. The www and hhh are the size of your
window; there are no corresponding variables.
Is there a way to apply $vpd to a single object as can be done with $vpr&t,
as opposed to the whole scene?
No. None of these apply to individual objects. They all control where
the camera is.
On 10/24/2020 7:34 PM, Caddiy wrote:
> I cannot assess your script, I haven't got that far. But are you sure the
> values of $vp* are in any way related to the number of pixels on your
> computer monitor?
They are not, but it all ties together.
$vpt says where the camera is relative to the model.
$vpr says which direction the camera is pointing.
I'm not sure exactly what $vpd represents, but effectively it's a zoom
control. (It's referred to as "distance", but I don't understand
exactly how it relates to $vpt.)
Now put a frame between the camera and the model. That's your window.
What you see on your screen is what the camera can see through that frame.
Another way to look at it is to relate them to how you manually position
the window using the mouse. The left mouse button is tied to $vpr, the
right mouse button to $vpt, and the wheel to $vpd.
The variables can be used to let the program look at where you've
manually positioned the camera, or let the program set the location of
the camera.
Create a simple model. cube(10) is fine. Note that at the bottom of
the window there's a like that says
Viewport: translate = [ xxx yyy zzz ], rotate = [ xxx, yyy, zzz ],
distance = ddd (www x hhh)
Watch how those numbers change when you use the mouse to look around the
model. $vpt is the "translate" numbers, $vpr is the "rotate" numbers,
and $vpd is the "distance" number. The www and hhh are the size of your
window; there are no corresponding variables.
> Is there a way to apply $vpd to a single object as can be done with $vpr&t,
> as opposed to the whole scene?
No. None of these apply to individual objects. They all control where
the camera is.
NH
nop head
Sun, Oct 25, 2020 8:09 PM
$vpd is the distance of the camera from the viewport which is a 2D
rectangle that frames the image and it subtends an angle at the camera
vertically equal to $vpf, the field of view.
On Sun, 25 Oct 2020 at 20:01, Jordan Brown openscad@jordan.maileater.net
wrote:
On 10/24/2020 7:34 PM, Caddiy wrote:
I cannot assess your script, I haven't got that far. But are you sure the
values of $vp* are in any way related to the number of pixels on your
computer monitor?
They are not, but it all ties together.
$vpt says where the camera is relative to the model.
$vpr says which direction the camera is pointing.
I'm not sure exactly what $vpd represents, but effectively it's a zoom
control. (It's referred to as "distance", but I don't understand exactly
how it relates to $vpt.)
Now put a frame between the camera and the model. That's your window.
What you see on your screen is what the camera can see through that frame.
Another way to look at it is to relate them to how you manually position
the window using the mouse. The left mouse button is tied to $vpr, the
right mouse button to $vpt, and the wheel to $vpd.
The variables can be used to let the program look at where you've manually
positioned the camera, or let the program set the location of the camera.
Create a simple model. cube(10) is fine. Note that at the bottom of the
window there's a like that says
Viewport: translate = [ xxx yyy zzz ], rotate = [ xxx, yyy, zzz ],
distance = ddd (www x hhh)
Watch how those numbers change when you use the mouse to look around the
model. $vpt is the "translate" numbers, $vpr is the "rotate" numbers, and
$vpd is the "distance" number. The www and hhh are the size of your
window; there are no corresponding variables.
Is there a way to apply $vpd to a single object as can be done with $vpr&t,
as opposed to the whole scene?
No. None of these apply to individual objects. They all control where
the camera is.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
$vpd is the distance of the camera from the viewport which is a 2D
rectangle that frames the image and it subtends an angle at the camera
vertically equal to $vpf, the field of view.
On Sun, 25 Oct 2020 at 20:01, Jordan Brown <openscad@jordan.maileater.net>
wrote:
> On 10/24/2020 7:34 PM, Caddiy wrote:
>
> I cannot assess your script, I haven't got that far. But are you sure the
> values of $vp* are in any way related to the number of pixels on your
> computer monitor?
>
>
> They are not, but it all ties together.
>
> $vpt says where the camera is relative to the model.
>
> $vpr says which direction the camera is pointing.
>
> I'm not sure exactly what $vpd represents, but effectively it's a zoom
> control. (It's referred to as "distance", but I don't understand exactly
> how it relates to $vpt.)
>
> Now put a frame between the camera and the model. That's your window.
> What you see on your screen is what the camera can see through that frame.
>
> Another way to look at it is to relate them to how you manually position
> the window using the mouse. The left mouse button is tied to $vpr, the
> right mouse button to $vpt, and the wheel to $vpd.
>
> The variables can be used to let the program look at where you've manually
> positioned the camera, or let the program set the location of the camera.
>
> Create a simple model. cube(10) is fine. Note that at the bottom of the
> window there's a like that says
>
> Viewport: translate = [ xxx yyy zzz ], rotate = [ xxx, yyy, zzz ],
> distance = ddd (www x hhh)
>
> Watch how those numbers change when you use the mouse to look around the
> model. $vpt is the "translate" numbers, $vpr is the "rotate" numbers, and
> $vpd is the "distance" number. The www and hhh are the size of your
> window; there are no corresponding variables.
>
> Is there a way to apply $vpd to a single object as can be done with $vpr&t,
> as opposed to the whole scene?
>
>
> No. None of these apply to individual objects. They all control where
> the camera is.
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
C
Caddiy
Mon, Oct 26, 2020 1:02 AM
Ah, now it works! Thanks.
Window y remains constant and window x can be set to the full width or minus
the preferred editor width. Unfortunately there is no $vpw[0].
I have added translate([-10,10,0]) to get the text out of the extreme corner
and text size=10 (which seems to be the default value) so that I just have
to change the number for bigger or smaller characters.
My code, for what it's worth:
//Code for fixed text
//Object magnification
x=01.00;
rotate([$t360,$t360,$t*360])
{
color("magenta")
cube(20);
color("lime")
sphere(2);
}
$vpd = 400/x; // Affects everything
translate([$vpt[0],$vpt[1],$vpt[2]]) // Affects text only
rotate([$vpr[0],$vpr[1],$vpr[2]]) // Affects text only
translate([-120/x,-70/x,0]) // = bottom left
color("black")
linear_extrude (height= 0.01)
text("Cube in a fix", font = "Times New Roman", size=8/x);
It would work nicely if distance (with $vpd) could be applied to the text
alone, as translate and rotate can, without affecting anything else.
--
Sent from: http://forum.openscad.org/
Ah, now it works! Thanks.
Window y remains constant and window x can be set to the full width or minus
the preferred editor width. Unfortunately there is no $vpw[0].
I have added translate([-10,10,0]) to get the text out of the extreme corner
and text size=10 (which seems to be the default value) so that I just have
to change the number for bigger or smaller characters.
My code, for what it's worth:
//Code for fixed text
//Object magnification
x=01.00;
rotate([$t*360,$t*360,$t*360])
{
color("magenta")
cube(20);
color("lime")
sphere(2);
}
$vpd = 400/x; // Affects everything
translate([$vpt[0],$vpt[1],$vpt[2]]) // Affects text only
rotate([$vpr[0],$vpr[1],$vpr[2]]) // Affects text only
translate([-120/x,-70/x,0]) // = bottom left
color("black")
linear_extrude (height= 0.01)
text("Cube in a fix", font = "Times New Roman", size=8/x);
It would work nicely if distance (with $vpd) could be applied to the text
alone, as translate and rotate can, without affecting anything else.
--
Sent from: http://forum.openscad.org/
M
MichaelAtOz
Mon, Oct 26, 2020 1:12 AM
Note that indentation of the code helps understand
which lines affect the next line.
Sequences of code affect the following lines until a ";" terminates that sequence.
e.g. (as an image so email doesn't affect it)
-----Original Message-----
Sent: Mon, 26 Oct 2020 12:03
Subject: Re: [OpenSCAD] Another missing feature? (All I want for Xmas...)
Ah, now it works! Thanks.
Window y remains constant and window x can be set to the full width or minus
the preferred editor width. Unfortunately there is no $vpw[0].
I have added translate([-10,10,0]) to get the text out of the extreme corner
and text size=10 (which seems to be the default value) so that I just have
to change the number for bigger or smaller characters.
My code, for what it's worth:
rotate([$t360,$t360,$t*360])
$vpd = 400/x; // Affects everything
translate([$vpt[0],$vpt[1],$vpt[2]]) // Affects text only
rotate([$vpr[0],$vpr[1],$vpr[2]]) // Affects text only
translate([-120/x,-70/x,0]) // = bottom left
linear_extrude (height= 0.01)
text("Cube in a fix", font = "Times New Roman", size=8/x);
It would work nicely if distance (with $vpd) could be applied to the text
alone, as translate and rotate can, without affecting anything else.
Note that indentation of the code helps understand
which lines affect the next line.
Sequences of code affect the following lines until a ";" terminates that sequence.
e.g. (as an image so email doesn't affect it)
> -----Original Message-----
> From: Discuss [mailto:discuss-bounces@lists.openscad.org] On Behalf Of Caddiy
> Sent: Mon, 26 Oct 2020 12:03
> To: discuss@lists.openscad.org
> Subject: Re: [OpenSCAD] Another missing feature? (All I want for Xmas...)
>
> Ah, now it works! Thanks.
>
> Window y remains constant and window x can be set to the full width or minus
> the preferred editor width. Unfortunately there is no $vpw[0].
>
> I have added translate([-10,10,0]) to get the text out of the extreme corner
> and text size=10 (which seems to be the default value) so that I just have
> to change the number for bigger or smaller characters.
>
> My code, for what it's worth:
>
> //Code for fixed text
>
> //Object magnification
> x=01.00;
>
>
>
> rotate([$t*360,$t*360,$t*360])
> {
> color("magenta")
> cube(20);
> color("lime")
> sphere(2);
> }
>
>
>
>
> $vpd = 400/x; // Affects everything
>
> translate([$vpt[0],$vpt[1],$vpt[2]]) // Affects text only
>
> rotate([$vpr[0],$vpr[1],$vpr[2]]) // Affects text only
>
>
> translate([-120/x,-70/x,0]) // = bottom left
>
> color("black")
>
> linear_extrude (height= 0.01)
>
> text("Cube in a fix", font = "Times New Roman", size=8/x);
>
>
> It would work nicely if distance (with $vpd) could be applied to the text
> alone, as translate and rotate can, without affecting anything else.
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
This email has been checked for viruses by AVG.
https://www.avg.com
NH
nop head
Mon, Oct 26, 2020 8:38 AM
Assigning to $vpd, $vpt and $vpr affect the camera, so that changes the
appearance of everything. Reading the values to know where the camera is
allows you to position individual objects in a fixed place relative to the
camera.
There is no need to split up the vectors and join them back together again.
[$vpt[0],$vpt[1],$vpt[2]] is just $vpt and can be passed to translate.
You assigned to $vpd to specify the zoom, whereas I read $vpd to change the
size of position of the text, so it doesn't change. It then doesn't matter
if $vpd is changed with GUI or is assigned to.
Not sure why you didn't just use the method I posted.
On Mon, 26 Oct 2020 at 01:13, MichaelAtOz oz.at.michael@gmail.com wrote:
Note that indentation of the code helps understand
which lines affect the next line.
Sequences of code affect the following lines until a ";" terminates that
sequence.
e.g. (as an image so email doesn't affect it)
-----Original Message-----
Sent: Mon, 26 Oct 2020 12:03
Subject: Re: [OpenSCAD] Another missing feature? (All I want for
Ah, now it works! Thanks.
Window y remains constant and window x can be set to the full width or
the preferred editor width. Unfortunately there is no $vpw[0].
I have added translate([-10,10,0]) to get the text out of the extreme
and text size=10 (which seems to be the default value) so that I just
to change the number for bigger or smaller characters.
My code, for what it's worth:
rotate([$t360,$t360,$t*360])
$vpd = 400/x; // Affects everything
translate([$vpt[0],$vpt[1],$vpt[2]]) // Affects text only
rotate([$vpr[0],$vpr[1],$vpr[2]]) // Affects text only
translate([-120/x,-70/x,0]) // = bottom left
linear_extrude (height= 0.01)
text("Cube in a fix", font = "Times New Roman", size=8/x);
It would work nicely if distance (with $vpd) could be applied to the text
alone, as translate and rotate can, without affecting anything else.
Assigning to $vpd, $vpt and $vpr affect the camera, so that changes the
appearance of everything. Reading the values to know where the camera is
allows you to position individual objects in a fixed place relative to the
camera.
There is no need to split up the vectors and join them back together again.
[$vpt[0],$vpt[1],$vpt[2]] is just $vpt and can be passed to translate.
You assigned to $vpd to specify the zoom, whereas I read $vpd to change the
size of position of the text, so it doesn't change. It then doesn't matter
if $vpd is changed with GUI or is assigned to.
Not sure why you didn't just use the method I posted.
On Mon, 26 Oct 2020 at 01:13, MichaelAtOz <oz.at.michael@gmail.com> wrote:
> Note that indentation of the code helps understand
>
> which lines affect the next line.
>
> Sequences of code affect the following lines until a ";" terminates that
> sequence.
>
>
>
> e.g. (as an image so email doesn't affect it)
>
>
>
>
>
> > -----Original Message-----
>
> > From: Discuss [mailto:discuss-bounces@lists.openscad.org] On Behalf Of
> Caddiy
>
> > Sent: Mon, 26 Oct 2020 12:03
>
> > To: discuss@lists.openscad.org
>
> > Subject: Re: [OpenSCAD] Another missing feature? (All I want for
> Xmas...)
>
> >
>
> > Ah, now it works! Thanks.
>
> >
>
> > Window y remains constant and window x can be set to the full width or
> minus
>
> > the preferred editor width. Unfortunately there is no $vpw[0].
>
> >
>
> > I have added translate([-10,10,0]) to get the text out of the extreme
> corner
>
> > and text size=10 (which seems to be the default value) so that I just
> have
>
> > to change the number for bigger or smaller characters.
>
> >
>
> > My code, for what it's worth:
>
> >
>
> > //Code for fixed text
>
> >
>
> > //Object magnification
>
> > x=01.00;
>
> >
>
> >
>
> >
>
> > rotate([$t*360,$t*360,$t*360])
>
> > {
>
> > color("magenta")
>
> > cube(20);
>
> > color("lime")
>
> > sphere(2);
>
> > }
>
> >
>
> >
>
> >
>
> >
>
> > $vpd = 400/x; // Affects everything
>
> >
>
> > translate([$vpt[0],$vpt[1],$vpt[2]]) // Affects text only
>
> >
>
> > rotate([$vpr[0],$vpr[1],$vpr[2]]) // Affects text only
>
> >
>
> >
>
> > translate([-120/x,-70/x,0]) // = bottom left
>
> >
>
> > color("black")
>
> >
>
> > linear_extrude (height= 0.01)
>
> >
>
> > text("Cube in a fix", font = "Times New Roman", size=8/x);
>
> >
>
> >
>
> > It would work nicely if distance (with $vpd) could be applied to the text
>
> > alone, as translate and rotate can, without affecting anything else.
>
> >
>
> >
>
> >
>
> > --
>
> > Sent from: http://forum.openscad.org/
>
> >
>
> > _______________________________________________
>
> > OpenSCAD mailing list
>
> > Discuss@lists.openscad.org
>
> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Virus-free.
> www.avg.com
> <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
> <#m_-6997805907647189939_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>