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?

  • Shawn CarterShawn Carter Member Posts: 0

    __ // http://forcoder.org // free ebooks and video tutorials about { PHP, Visual Basic, Python, Perl, C#, Delphi, Scratch, C, JavaScript, R, Visual Basic .NET, C++, Swift, MATLAB, Ruby, Go, Java, Assembly, Objective-C, PL/SQL Rust, Erlang, Lisp, Scala, LabVIEW, Kotlin, Lua, Clojure, Bash, Prolog, ML, Transact-SQL, Hack, FoxPro, Crystal, Fortran, Awk, Apex, Alice, Dart, ABAP, D, Scheme, VBScript, Julia, Ada, COBOL, F#, SAS, Logo } __

Sign In or Register to comment.