# how can I get the furthest x, y z postins seeable

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

## Recommended Posts

Hi, I know how to get the frustum (projection matrix by model matrix). So from this, suppose I'm at position x,y,z and I'm facing in a direction theta (where 0 degrees theta is facing directly down the -ve z axis) - how can I find the minx and max, minz and maxz points in the world that I can actually see in the frustum ? cheers

##### Share on other sites
you have:

aspect ratio=width/height, probably 1.333333333...
fovy=45 or something like that.

nearpl. far plane|     _-||   _-  || _-fov ||<------| ---> camera direction| ^-    ||   ^-  ||     ^-|

so, to get the maximal height multiply the farplane distance by the sin of the fov (sin(45)=0.70710678118654752440084436210485 ... sin(45)*100.0f (or some other far plane distance) = 70.7106781186547524400844362104.

Now, i don't know for sure if its rectangular like in the nice picture i drawed or if it means the total distance, not just the straightforward distance (hmm hard to explain).

If it's rectangular the right top point will be (sin(45*aspectratio)*farplanedist),70.710....

Anyway this is probably not the correct way but i'm not that far off. Just messing around with things like sin(45)*aspectratio instead of sin(45*aspectratio) will more than likely result in the right combination, a bit onorthodox i must admit but this trying works for me, also to understand things better.

##### Share on other sites
the answer to this is on the faq at www.opengl.org

1. 1
2. 2
Rutin
21
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633736
• Total Posts
3013602
×