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 2 of 2

Thread: Plotting 3D Coordinates onto a 2D Plane

  1. #1
    Junior Member Newbie
    Join Date
    May 2012
    Posts
    1

    Plotting 3D Coordinates onto a 2D Plane

    If I know the [x y z] coordinates of a star in space, with earth as the origin (units in light years to be specific), how can I transform that coordinate vector into an [x y] coordinate that I can plot with the centre of the constellation at the origin. I would like to be able to input the [x y z] coordinates of the stars to a program and have a automatically generate the image of what the constellation would look like from earth.

    Once I know I don't have to physically draw the what the constellation would like from looking at others.

    Any input will be accepted.

    Thanks,
    Justin

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    720
    For rendering you setup a worldview matrix with the eye point at the origin and the lookat point as the centre of the constellation. You will need to experiment with an up because depending on what you chose the consellation will look rotated.
    Code :
    gluLookAt(0.0,0.0,0.0,constellation_centre_x,,constellation_centre_y,constellation_centre_z,0.0,1.0,0.0); // y axis as up

    This assumes all your coordinates use earth as the origin.

Posting Permissions

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