Skip to main content
GameDev.net gamedev.net
🔒 Locked

Camera/Screen Width

Started by Drazgal May 19, 2003 at 7:35 AM 0 replies 300+ views
Original Post
Drazgal
Drazgal
What I want to do is keep my camer a certain value above the highest point of my terrain that is below the screen. I can easily test against the exact position of the camer, but I also want to test along the screen extent. With my angle of the camer I can work out the ''line'' that the screen would take, but I dont know when to stop testing, my first tohught was to test against the view frustum but that wouldnt test agains the vertices that are below and out of the cameras sight right? So my question is, how do I find out (in world space units) the width of the camera (well not really the camera but the viewing space that I draw to the screen if you get what I mean), the best idea I have is if I find the distanc from the near plane to the camera I can work out the height using tan(fov/2) (taken from the diretx sdk docs) then use the height width ratio to find the height. Unfortunatly I dont know if that would get what I want or how to find the distance between the two. Any ideas on how I should be doing this to get the answer I want or what books/ articles I should read that would give me an idea (I tried searching but I dont really know what Im looking for). Thanks for any help in advance.

Topic Locked

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

Sign in to reply to this topic.