projecting points onto a plane

I want to find out the (x, y) coordinates on the screen of a point (x, y, z) in space. I need mouse interaction that why.

I'm using openGL.

TIA

James

Comments

  • Use gluUnProject.

    Red book specifically talks about this. Version 1.1 is available online.

    : I want to find out the (x, y) coordinates on the screen of a point (x, y, z) in space. I need mouse interaction that why.
    :
    : I'm using openGL.
    :
    : TIA
    :
    : James
    :

  • : Use gluUnProject.
    :
    : Red book specifically talks about this. Version 1.1 is available online.
    :
    : : I want to find out the (x, y) coordinates on the screen of a point (x, y, z) in space. I need mouse interaction that why.
    : :
    : : I'm using openGL.
    : :
    : : TIA
    : :
    : : James
    : :
    :
    :

    X = centerxOfScreen - (pointX * 256) / (distance - pointZ)
    Y = centeryOfScreen - (pointY * 256) / (distance - pointZ)

    taken from 3d Graphics tuts.

  • sorry but you must mean Ex Programmer

    you forgot about the camera!

    anyway the initial response solved the problem!!

    nm.

    : X = centerxOfScreen - (pointX * 256) / (distance - pointZ)
    : Y = centeryOfScreen - (pointY * 256) / (distance - pointZ)
    :
    : taken from 3d Graphics tuts.


    [hr]

    What does God need with a starship?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories