Skip to main content
gamedev.net
🔒 Locked

perspective projection problem

Started by digitalfreak Oct 13, 2003 at 11:07 PM 0 replies 300+ views
Original Post
digitalfreak
digitalfreak
say I have a straight line in world space,and now I use perspective projection to project it onto the projection plane,then the shape I''ll get on the projection plane is of course still a strait line,but if you take a look at the math,there''re some problems(d is the viewing distance or the projection plane''s Z value,Xper and X denote the X coordinate in perspective space and world space respectively): since Xper = dX/Z -->X = ZXper/d, Yper = dY/Z -->Y = ZYper/d, and because Y=kX+b in world space,we plug the above X,Y in: ZYper/d=kZXper/d+b -->Yper=kXper+bd/Z which means Yer is not linear with Xper(because of the 1/Z),then the shape we got on the projection plane isn''t a straight line?
digitalfreak
digitalfreak
Ah,I know where goes wrong.I didn''t take into consideration that X,Y,Z''s relationship are regulated by the 3D line''s equation.Say X=aZ+b,Y=pZ+q,then I have
Xper=dX/Z=da+db/Z
Yper=dY/Z=dp+dq/Z
thus Xper and Yper are linear.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.