|
Author |
Topic: Coordinate Matrix (Read 794 times) |
|
Mike Davis
|
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
|
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).
|
|
|
|
|