   Projection
  Hey.This seems like something simple but im having trouble with it.I want to write a function to get the 2D screen coordinates of the origin of a 3D object in my scene by using my projection and view matrix and the objects transformation matrix (and whatever else i might need). i thought just multiplying them all together would work but aparently not (unless im making another mistake somewhere).Thnx in Advance!   
  OK. for these tests my screen resolution was 640x480. but the results scale perfectly with resolution.i use the following method to try and determine the 2D position of my object:public Vector2 project(Matrix4 pos){  Vector3 temp = new Vector3().applyTransformation(DMEngine.projectionAndViewMatrix.multiply(pos)); //creates a vector at (0,0,0) and transforms it by the product of DMEngine.projectionAndViewMatrix and pos  print(DMEngine.projectionAndViewMatrix + "\n" + pos +"\n"+ temp.x + "  " + temp.y + "   " + temp.z;  return new Vector2(temp.x,temp.y);}note: DMEngine.projectionAndViewMatrix is a singleton. DMEngine.projectionAndViewMatrix and pos gets used by my shaders to draw the scene so im almoust confident they are correct :Pwhen my object is more or less in the center of my screen this is the result im getting.1.4142148,    0.0, 1.4142123,19534.156,1.333323,1.8856316,-1.3333254,    -2209.9194,0.50020313,   -0.70738477,   -0.500204,-295.44376,0.5000031,    -0.7071019,    -0.500004,-291.32642,  6.0,0.0,0.0,-6078.0,0.0,6.0,0.0,21.0,0.0,0.0,6.0,-7728.0,0.0,0.0,0.0,1.0,  9.525391  29.680176   515.04333so the 2D location i get is in the lower left hand corner of my screenwhen my object is more or less in the top right corner of my screen this is the result im getting1.4142135,0.0, 1.4142135,20129.404,1.3333125,1.8856478,-1.3333125,    -1732.0605,0.5002079,-0.7073786,    -0.5002079,    -116.17945,0.50000787,    -0.70709574,   -0.50000787,   -112.13379,6.0,0.0,0.0,-6078.0,0.0,6.0,0.0,21.0,0.0,0.0,6.0,-7728.0,0.0,0.0,0.0,1.0,604.7715  507.50342   694.3086so the 2D location is just above the screens top right corner. Notice the z value... im just throwing it away. not sure if im suposed to to something with it but then again im stil pretty clueless altogether. Also note that the objects location stayed the same in both examples. Only the camera moved.I hope these numbers can help in finding out where my problem lies.Thnx in Advance!   ;  I completely forgot about gluProject... I can probely just use that. Il give it a try.EDIT: yes that works just fine.[Edited by - EternityZA on June 1, 2010 10:52:18 AM];New Content for Windows Phone on XNA Game Studio 4.0 including: Game State Management and Gestures. View the full article