Another missing feature? (All I want for Xmas...)

classic Classic list List threaded Threaded
37 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Another missing feature? (All I want for Xmas...)

Caddiy
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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

MichaelAtOz
Administrator
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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/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.
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

MichaelPFrey
In reply to this post by Caddiy
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


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

Caddiy
In reply to this post by MichaelAtOz

You can use  these variables
&lt;https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_Language_Features#$vpr,_$vpt,_$vpf_and_$vpd&gt; 
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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

Caddiy
In reply to this post by MichaelPFrey

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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

MichaelAtOz
Administrator
In reply to this post by Caddiy
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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/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.
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

MichaelAtOz
Administrator
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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/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.
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

Caddiy

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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

MichaelAtOz
Administrator
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
[hidden email]
http://lists.openscad.org/mailman/listinfo/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.
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

MichaelAtOz
Administrator

...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:[hidden email]] On Behalf Of MichaelAtOz

> Sent: Wed, 21 Oct 2020 09:34

> To: [hidden email]

> 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

> [hidden email]

> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


Virus-free. www.avg.com

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/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.
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

Caddiy

/...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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

MichaelAtOz
Administrator
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
[hidden email]
http://lists.openscad.org/mailman/listinfo/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.
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

nophead
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 <[hidden email]> 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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

Caddiy
In reply to this post by MichaelAtOz


/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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

MichaelAtOz
Administrator
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/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/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.
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

Caddiy
In reply to this post by nophead


/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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

nophead
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.png



On Thu, 22 Oct 2020 at 00:04, Caddiy <[hidden email]> 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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

Caddiy


/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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

nophead
$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 <[hidden email]> 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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Another missing feature? (All I want for Xmas...)

Caddiy


/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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
12