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 & HelpSyntax Questions › translate & pop/pushmatrix
Page Index Toggle Pages: 1
translate & pop/pushmatrix (Read 507 times)
translate & pop/pushmatrix
Jun 13th, 2006, 4:44pm
 
i'm having a problem keeping my coordinate systems intact.

i would like to push the current system into the stack, translate center to my location of interest, rotate, print some text, then pop the previous coordinate system.

this code isn't working correctly as is:

   pushMatrix();
   Vertex v = model.getVertex(i);
   translate(v.vx, v.vy, v.vz);
<insert rotations, etc>
   fill(0);
   textFont(font, 20);
   text(i+" little vertex");
   popMatrix();


however this code does, except I cannot rotate or otherwise modify the positon of the text other than to put it in the correct location

   Vertex v = model.getVertex(i);
   fill(0);
   textFont(font, 20);
   text(i+" little vertex", v.vx, v.vy, v.vz);
Re: translate & pop/pushmatrix
Reply #1 - Jun 14th, 2006, 8:38pm
 
i've figured this out. to avoid the extra translation problems, use text("blah", 0, 0, 0) instead of text("blah")
Page Index Toggle Pages: 1