We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › orientation of text() in 3D (appears with Y-flip)
Page Index Toggle Pages: 1
orientation of text() in 3D (appears with Y-flip) (Read 2473 times)
orientation of text() in 3D (appears with Y-flip)
Jun 6th, 2010, 6:32am
 
Dear all,

I'm trying to render 3D text over artoolkit markers.  The text is rendered at the correct position on the x-y plane of my object and runs from small x to large x, all as expected.  However, the text is flipped on the y-axis, as if it was rendered to be viewed from negative z, whilst I'm viewing it by artoolkit definition from positive z.

My question is: How can I specify the orientation of text() in 3D space?  I've looked at textMode and textAlign and searched the forum, but I've not been able to find an answer.

See this screenshot for more information (x+ and y+ are in fact positive x and y, and line orthogonal to those two axes is positive z):
(argh, I'm not allowed to post an img link yet. please PM me if you'd like to see this.)

Thanks for any help!

Re: orientation of text() in 3D (appears with Y-flip)
Reply #1 - Jun 6th, 2010, 6:37am
 
Hopefully I can now insert that screenshot:
...
Re: orientation of text() in 3D (appears with Y-flip)
Reply #2 - Jun 6th, 2010, 6:38am
 
i am not sure if i understood it correctly. The screenshot would help Smiley

but you can flip your text using scale
for example
scale(1,-1);
or scale(-1,1);

dont forget to use pushMatrix() popMatrix(); to just flip the text
Re: orientation of text() in 3D (appears with Y-flip)
Reply #3 - Jun 6th, 2010, 7:02am
 
Dear Cedric,

Thanks for your fast reply.  You'll see that I've managed to post the screenshot now.

I had already experimented with scale() and also RotateX().  This indeed works, but it means that if I actually want text to appear at the top for example, I have to do:
RotateX(PI); // or scale (1,-1,1)
// I have to second-guess rotate and spec -20 instead of 20
text("the text", 0, -20, 0);
...

In short, because the y-flip is active to fix text *orientation*, I have to pre-flip all position y-coordinates.  I was wondering if there were a better solution.

Thanks again,
Charl
Page Index Toggle Pages: 1