Howdy, Stranger!

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

projecting points onto a plane

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

• Member Posts: 642
Use gluUnProject.

: 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
:

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

• Member Posts: 240
sorry but you must mean Ex Programmer

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?

• 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 } __