Howdy, Stranger!

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

Categories

projecting points onto a plane

JamesFosJamesFos Member Posts: 240
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

  • gautamgautam Member Posts: 642
    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
    :

  • programmerEXprogrammerEX Member Posts: 16
    : 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.

  • JamesFosJamesFos Member Posts: 240
    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.