Jump to content
  • Advertisement
Sign in to follow this  
Gnarlyman

How to code cameras and draw distances

This topic is 2477 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

I'd like to know...

How is the actual camera, and what it views, and et cetera, programmed? Obviously, that's tied to draw distance, but much more so, I'm very curious/puzzled as to the math/programming involved in cameras, which obviously have to "draw more of" the environment with the receding distance. Is there a certain ratio or math to get the cam to look right? I'm trying to code a camera system from scratch, and I'd like to know how to go about it. I hope this Q is coming across in a more or less understandable manner...

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
A camera is basically a view matrix and a projection matrix. The view matrix describes where the camera is in space and where it is facing, and the projection matrix defines how the 3D world is transformed into 2D points for display (e.g. the field-of-view of the camera).

http://robertokoci.c...atrix-unveiled/

Share this post


Link to post
Share on other sites
Thanks, I looked all of that up and have gotten a good handle on it. Thanks again. My next question would be...

What's the general logic and process that governs the detection of meshes and...everything in the environment, really, within the viewing frustum?

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!