Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have 4 angles, left, right, top & bottom. These angles are in degrees. They define the angle between the forward vector and the corresponding side. I am trying to use these to calculate the required values for Perseective Off Centre function found here http://docs.unity3d.com/Documentation/ScriptReference/Camera-projectionMatrix.html I tried doing (near plane-far plane) * Tan(angle) But that didn't give the correct results.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You have to know exactly what you're looking for. I believe TOP in the referenced link here refers to what I call o in the diagram below.

enter image description here

You just need to complete this for every angle. Keep in mind the far plane is measured from eye TO the far plane, and so is the Near plane. Both near and far should always be positive because they measure a distance from the eye. So you don't do far plane - near plane and you definitely don't do near plane - far plane (that will always be a large negative value).

share|improve this answer
    
That is a very similar diagram to what I had on paper :). I see what I did wrong. Don't know why I tried 'near - far'. I'll try it out and let you know if it works. Thank you. –  MulletDevil Nov 27 '12 at 21:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.