[X3D-Public] Place a light in 'eye coordinates'

Michalis Kamburelis michalis.kambi at gmail.com
Fri Jun 22 18:12:48 PDT 2012

Rob McDonald wrote:
> I would like to place a
> <DirectionalLight color="1 1 1" intensity="1.0" direction="0 0 -1"
> global="true" />
> in 'eye coordinates' such that the objects in my scene are always lit
> 'from above'.
> I understand that the headlight is in eye coordinates -- and I
> understand how to turn it on/off, but I haven't been able to figure
> out how to add other lights in eye coordinates.

Using ProximitySensor you can make a Transform node that follows the 
camera position and orientation. Thus, the local coordinate system of 
this Transform node corresponds to the eye coordinates, and you can 
place anything you want this way relative to the camera (lights, text, 
animated avatar of the player etc.)

I'm attaching a simple example how to do this (use ProximitySensor, and 
place a sphere and directional light in eye coords) in X3D classic 
encoding (you'll figure out how to convert it to XML encoding, if you 
need :)

See the X3D spec for details of course, in particular ProximitySensor is 
part of "Environmental sensor component", 

> P.S. I'm not sure that this is the best place to ask this kind of
> question about X3D, but I can't seem to find a more appropriate place.
>   If there is a better place, please let me know.

I think this is the perfect place to ask questions about X3D :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: proximity_sensor_orientation.x3dv
Type: model/x3d+vrml
Size: 675 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20120623/6d58e98d/attachment.bin>

More information about the X3D-Public mailing list