[x3d-public] combine light scoping with rotation transform

doug sanden highaspirations at hotmail.com
Sat Jul 25 07:05:30 PDT 2015


Andreas,
I suspect you'll need to use the location and direction attributes of the lights, rather than a transform wrapper, to keep the light as sibling to your geometry while rotating it. You may need to convert an axis-angle rotation to a direction vector.
-Doug

>
> X3D experts,
>
> I got stuck on a what must be a basic issue with light scoping.
>
> http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/lighting.html#Scopingoflights
>
> I want to use scoping for a directional light, eg. with a global field
> set to 'false'
>
> <Group>
> <DirectionalLight global='false' ... />
> <Shape DEF='illuminated_by_directional_light>
> ...
> </Shape>
> </Group>
>
> <Group DEF='not_illuminated_by_directional_light'>
> ..
> </Group>
>
> Would this be the correct hierarchy to use ?
>
> Now I also want to enclose the directional light in a transform, in
> order to control it by a routed rotation from a OrientationSensor. At
> the same time, I do not want to rotate the illuminated shape.
>
> <Group>
> <Transform DEF='light_Trafo'>
> <DirectionalLight global='false' ... />
> </Transform>
> <Shape DEF='illuminated_by_directional_light>
> ...
> </Shape>
> </Group>
> <Group DEF='not_illuminated_by_directional_light'>
>
> However, now the Shape is outside the scope of the light, and not
> affected by it.
>
> This is where I am stuck. What would be the correct hierarchy to use
> for this case ?
>
> This is rather theoretical for me because I believe the global field is
> not supported by x3dom at this point:
>
> https://github.com/x3dom/x3dom/issues/83
>
> -Andreas

 		 	   		  


More information about the x3d-public mailing list