[RESOLVED] World to screen coordinates. [Left handed coord]
Grrrr...first time I actualy need this, then I have forgotten my book back in Norway..hmm...well I need to transform world coordinates to screen coordinates. So if I am not wrong, this will have to go through eye coordinates:
World -> Eye/Camera -> Screen
I think I remember how to transform from Eye to Screen now, but I can't remember exactly how to go from World to Eye. Any help here?
If I am not wrong, it is something like:
Eye-coordinates = Camera-Matrix * World-Coordinate
But how does the world matrix look like then? I guess it is a 4*4matrix, and 3 of the rows/colums are LookAt-vector, Up-vector, and something else (cross product of the two?). but in what order are they? Is it something like this?
---------------------------
- View Reference Point (VRP)
- View Plane Normal (VPN)
- View Up (VUP)
---------------------------
Matrix:
Code:
VUP*VPN 0
VUP 0
VPN 0
0 0 0 1
or are they ordered in colums or is it an other order of them. Any shed of light on this would be nice..:) Even a link to a tutorial that goes through it step by step with an example would proably help me at this point..:)
Thanks
- ØØ -
Re: World to screen coordinates. [Left handed coord]
I am not sure if this link to an article entitled "World to Screen Projection Transformation" will be of any help. Nevertheless, it seemed to me so. It includes the source code.
http://astronomy.swin.edu.au/~pbourk...ion/transform/
Good luck
Re: World to screen coordinates. [Left handed coord]
i all ready saw that page..but they never explained the math behind it, so it is hard to test if it really works as it should. Since I have to port the code to an other language anyway. But thanks for the link. I might use it as a last resort...:)
- ØØ -
Re: World to screen coordinates. [Left handed coord]
Re: World to screen coordinates. [Left handed coord]
Thanks, yeah the second one was helping a bit. Even if it doesn't explain it all. But I think I am geting closer. But I hate that they are not even telling what kind of coordinate system they are using. I think this is right handed...but not 100% sure...:(
- ØØ -
Re: [RESOLVED] World to screen coordinates. [Left handed coord]
I managed to fix it in the end...and yes it is beautifull...:)
- ØØ -