FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Syntax
(Moderators: fry, REAS)
   Coordinate Matrix
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Coordinate Matrix  (Read 794 times)
Mike Davis

WWW
Coordinate Matrix
« on: Dec 20th, 2002, 3:52am »

Is it possible to access the components of the coordinate matrix?  After transformations, I'd like to determine where I'm at in the context of the original coordinate space.
 
fry


WWW
Re: Coordinate Matrix
« Reply #1 on: Jan 2nd, 2003, 5:56pm »

hm, i'm not sure what you're looking for, exactly..  
 
are you looking for the transformation matrix for how points are being manipulated? or a way to transform points using that matrix? or something else?
 
the model matrix is a 4x4 of floats stored in 'g', and can be accessed by g.mRC where X and Y are the row and column of the matrix. as in, g.m00 is row zero, column 0.
 
the projection matrix is similar, except it's g.pRC. so g.p00 is row 0 col 0 of the projection. g.p33 is row 3 col 3.
 
if you want to transform an xyz point to see how it would turn out in screen space, first call project(x, y, z) for your point, then use g.projX, g.projY, g.projZ to get the output values. the x and y will be the pixel location where the point would end up on screen, the z value is the ordering info for the zbuffer. the naming of projX etc will change for beta if i can just think of something better (suggestions are welcome).
 
Pages: 1 

« Previous topic | Next topic »