# how to calculate 3d rectangle's coordinate by camera

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

## Recommended Posts

when a 3d rectangle pretend to be a 2d plane,how can I get correspond coordinate while the camera is dynamic? for example:I create a retangle P1:-960,-540,0 P2:-960 ,540,0 P3: 960, 540,0 P4: 960,-540,0 glBegin(QUADS) glVertex3f(-960,-540,0); glVertex3f(-960,540,0); glVertex3f(960,540,0); glVertex3f(960,-540,0); glEnd() my viewport width is 1920 and height is 1080 and I wish it look like a 2d plane, so how can I get exactly coordinate let rectangle look like a 2d plane and filled of screen? now I am using a stupid method, adjust position of camera,and let it look like a 2D plane,but this is quite stupid :( may someone explain how I can calculate 3d coordinate? I knew how to rending it by 2D,but I wanna using a flying plane into screen,and it could exactly filled the screen. thanks for any advice :)

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 28
• 16
• 10
• 10
• 11
• ### Forum Statistics

• Total Topics
634103
• Total Posts
3015538
×