Jump to content
  • Advertisement
Sign in to follow this  
nini

Simple Maths , Screen coordinate

This topic is 5399 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 , i'm implementing a lens flare effect , what i'm doing is simple, i translate Light position from World Space to Screen Space like this : LightPos * MatView * MatProj but the coordinate i found are false... how to project LightPos in Screen Coordinate ? Should i take care of ViewPort Transformation & Scaling ? Thanx for your answers ...

Share this post


Link to post
Share on other sites
Advertisement
After that matrix multiplication you need to do perspective divide to get normalized device coordinats and then remap them to viewport. I sugest you take a look at redbook how opengl does this. DX probably has simmilar help resources.

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!