At the position z = 0 my box has size on one side 0.2. When, for example, I move it to z = 1.5, size of it scale up. I've trided to calculate it by using triangle formula z*tan(fov/2), but it does not really work.

Do you know how to get size of one side after primitive moved on z axis ?

(All about in opengl)

  • \$\begingroup\$ Are you looking for perspective projection? \$\endgroup\$
    – DMGregory
    Feb 13, 2019 at 22:02
  • \$\begingroup\$ Yes, I am looking perspective projection \$\endgroup\$
    – mgs_bravo
    Feb 14, 2019 at 16:25
  • \$\begingroup\$ Are you trying to find out the size of the object on the screen after it's been altered with perspective projection? I feel like you are trying to do something that has a simpler solution than calculating the perspective translation from a camera. \$\endgroup\$ Feb 15, 2019 at 12:42
  • \$\begingroup\$ well, actually I am trying to implement my own RayTest, using for now just a simple rectangle (without rotations) for rigid body. and when I am putting it closer then calculating if world ray coordinate belongs to rectangle or not gives me incorrect result due to scaling effect \$\endgroup\$
    – mgs_bravo
    Feb 15, 2019 at 22:42


You must log in to answer this question.

Browse other questions tagged .