Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 8 of 8

Thread: how to Calculate the Irradiated area?

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    5

    how to Calculate the Irradiated area?

    in Three-dimensional space, i know the positon of camera and Target point,how to Calculate the Irradiated area on Plane with z=0?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,099
    What irradiated area? Do you want to know how large the visible area of the xy-plane (z = 0) is?

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    5
    Quote Originally Posted by thokra View Post
    What irradiated area? Do you want to know how large the visible area of the xy-plane (z = 0) is?
    yes!! how can i do it ?

  4. #4
    Junior Member Newbie yoyonel's Avatar
    Join Date
    Sep 2010
    Location
    Paris
    Posts
    23
    Quote Originally Posted by yanasdf789 View Post
    yes!! how can i do it ?
    lol it's a joke yanasdf789
    The xy-plane(z=0) is infinite, like all planes of "space" (dimension(s) >= 1).

  5. #5
    Junior Member Newbie yoyonel's Avatar
    Join Date
    Sep 2010
    Location
    Paris
    Posts
    23
    Irradiated area on Plane with z=0 ... mmmMMMmm ...
    you want to compute the area of the projection of the xy-plane (z=0) on the near plane of your camera ?

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,099
    Irradiated area on Plane with z=0 ... mmmMMMmm ... you want to compute the area of the projection of the xy-plane (z=0) on the near plane of your camera ?
    Hence the term "visible" ... The OP wants to know how large the visible area of the XY plane is - depending on the current parameters of the camera.

    yanasdf789: is your camera always orthogonal to the plane or not?

  7. #7
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    5
    Quote Originally Posted by thokra View Post
    Hence the term "visible" ... The OP wants to know how large the visible area of the XY plane is - depending on the current parameters of the camera.

    yanasdf789: is your camera always orthogonal to the plane or not?
    if I know the the current parameters of the camera and camera always orthogonal to the plane,how to compute the area of the projection of the xy-plane (z=0)

  8. #8
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    474
    Quote Originally Posted by yanasdf789 View Post
    if I know the the current parameters of the camera and camera always orthogonal to the plane,how to compute the area of the projection of the xy-plane (z=0)
    For a centred perspective projection:

    The height is 2 * camera_z * tan(fovy/2)
    The width is 2 * camera_z * tan(fovy/2) * aspect
    The area is (2 * camera_z * tan(fovy/2))2 * aspect.

    Where camera_z is the Z coordinate of the camera's position, and fovy and aspect are the corresponding parameters to the gluPerspective() call.

    For a generalised perspective projection:

    The height is (top - bottom) * camera_z / nearVal
    The width is (right - left) * camera_z / nearVal
    The area is (right - left) * (top - bottom) * (camera_z / nearVal)2

    where camera_z is the Z coordinate of the camera's position, and the other variables are the corresponding parameters to the glFrustum() call.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •