|
Hi, Robert,
Thanks for your quickly response. If use ABSOLUTE_REF, do the light
position is defined in Eye Coordinate Space?
Yigang
----- Original Message -----
Sent: Tuesday, September 05, 2006 11:28
PM
Subject: Re: [osg-users] about the position
of osg::Lightsource
Hi,
On 9/5/06, Yigang
Wang <[EMAIL PROTECTED]>
wrote:
I want to get the light
position of osg::Lightsource. However, I donot know in what
coordinate system the position defines. If I use ABSOLUTE_REF, It
seems the position is defined in Eye Coordinate Space. If I use
RELATIVE_REF, it just can be looked as a normal node to
get the world coordinates ( which root node lies). Is it
correct? I need caculate the lighting by
myself.
If the relative case you can use the osg::Node
method:
/** Get the list of
matrices that transform this node from local coordinates to world coordinates.
* The optional
Node* haltTraversalAtNode allows the user to prevent traversal beyond a
specifed node. */ MatrixList
getWorldMatrices(osg::Node* haltTraversalAtNode=0) const;
Another question about directional light.
Normally we define glLightPosition( 0, 0, 1, 0) as the head light. Is
it defined in Eye coordinate space? the light direction is from (0, 1,
0) to (0, 0, 0)? Is the correct? for every directional light, the direction
is from the defined position point to (0, 0,
0).
With lighting when you set the w
value to 0, the x,y,z position is effectively the becomes a direction vector,
rather than a position as you'd normally think about a (x,y,z,1) coordinate.
Robert.
_______________________________________________ osg-users mailing
list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
|