Convertion from 2D to 3D and 3D to 2D Author Message
McTomas
Member

 Post: #1 Convertion from 2D to 3D and 3D to 2D Hi, I know the existence of PosToScreen() and ScreenToPos() methods, but I'm a little confuse about the conversion between 2D and 3D in objects. Is Vec2 the 2D object of Vec? If yes, why is there two different results from: Code: ```    Vec(0,0.5,0).v2.draw(WHITE);     PosToScreen(Vec(0,0.5,0)).draw(WHITE);``` If not, was is it then? The same thing happens with Edge to Edge2 and Tri to tri2. Probably I'm doing somthing wrong or I got it all wrong, but I'm really confused in here. (This post was last modified: 04-13-2010 11:48 PM by McTomas.)
04-13-2010 11:46 PM
Rofar
Member

 Post: #2 RE: Convertion from 2D to 3D and 3D to 2D Vec2 is just a 2 dimensional vector for 2 of the components of the 3D vector. PosToScreen results in the 2 dimensional vector of the 3D world position translated/projected to the 2 dimensional display.
04-14-2010 10:28 PM
McTomas
Member

 Post: #3 RE: Convertion from 2D to 3D and 3D to 2D Ok, thank you. So Vec(0,0.5,0).v2 = Vec2(0,0.5) Thanks
04-15-2010 01:26 AM
 « Next Oldest | Next Newest »