Jump to content
  • Advertisement
Sign in to follow this  
svnstrk

precision problem?

This topic is 3164 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, im trying to make a program that with a given camera position and perspective view, it draw a certain object(triangle). and then i try to compare with if i do the matrix multiplication by myself. this is the code of the program: codee there are lots of unused part but here is what i did: i read the object and calculate the normals in init() method (line 58) for the first draw, i set the perspective and lookat at onReshape() method (line 185) i draw the triangle in renderscene method (line 127) and draw the real triangle on the second part (138-146) i grab the perspective and lookat matrix (line 97 - 104) multiply it with the triangle vertex (line 107-109) and draw the triangle with perspective and lookat set to identity (line 129-136) the result is (probably) right but not exactly right. here is some of the grabbed scene: i used double and all the matrix,, vector method seem to work properly. any idae why is this happen? thanks in advance [Edited by - svnstrk on April 14, 2010 4:53:00 PM]

Share this post


Link to post
Share on other sites
Advertisement
i notice a tendency that the farther the point from 0, the larger the error



the lower vertex is 0, 0, 0

[Edited by - svnstrk on April 14, 2010 4:47:14 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!