Hi.
I've been trying to get picking to work on an orthogonal projection
using the camera->calcViewRay(...) function.
I've tried using a matrix camera with the identity matrix as projection
matrix and also the new orthogonal camera. What I believe is the problem
is that neither the matrix camera nor orhogonal camera has reimplemented
the calcViewRay() method.
Since the orthogonal camera is perfect for my purpose, I decided to
calculate the position and direction for the line in the calcViewRay
method myself. This works as long as the scene is not rotated, which
baffles me. I assumed that the direction for a ray from the orthogonal
camera would always be parrallel to the -z axis. Here's a link to a
modified 'testOrthogonalCamera.cpp' containing the code for the picking:
http://www.daimi.au.dk/~alras/orthoPick.tar.bz2
During my debugging of all this picking-stuff, I believe I found an
ambiguity. The doc for camera->calcViewRay() states:
"Calculate a ray that starts at the camera position and goes through the
pixel /x/, /y/ in the viewport /port/. /x/ and /y/ are relative to the
viewport's lower left corner."
In the example "testPicking.cpp" which uses GLUT has (0,0) in the upper
left corner however.
/Allan
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users