<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">snip</blockquote><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
> Perhaps light scope would need to be defined more flexibly than the<br>
> global field allows. I could see a "scope" field which defaults to<br>
> 'global' and otherwise contains the DEF of a group to which the light<br>
> should be applied. Would this interfere with some default logic of<br>
> scene traversal ?<br>
<br>
That's interesting, may lead to some ideas, but has a gotcha: the transform stack above the DEF is needed too in order to pose the light<br></blockquote><div><br></div><div>Yes, the full transform stack affecting the group to be illuminated by the scoped light needs to be known to actually produce the correct rendering. I am rephrasing to make sure I understand. If I do, I am not sure where the gotcha is. Is something not well defined ? Or is it a potentially prohibitive difficulty in implementation ?</div><div><br></div><div>There may be other ways to define a separation of the light scope from the lights position in the grouping and therefore transform hierarchy but I cannot think of one. Some wilder ideas are to use the routing concept ? "route" a light to a group ? Or have a separate hierarchy just for scoped lighting ? </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Q. would it work to rotate the parent instead of the light, then counter-rotate the shape sibling so as to nullify the shape being rotated??<br></blockquote><div><br></div><div>Like this ?</div><div><br></div><div><font face="monospace, monospace"><Transform rotation='rot'></font></div><div><font face="monospace, monospace">  <dLight direction='0 0 1' /></font></div><div><font face="monospace, monospace">  <Transform rotation='counter_rot'></font></div><div><font face="monospace, monospace">    <Shape DEF='illuminated'></font></div><div><font face="monospace, monospace">..</font></div><div><font face="monospace, monospace">    </Shape></font></div><div><font face="monospace, monospace">  </Transform></font></div><div><font face="monospace, monospace"></Transform></font></div><div><font face="monospace, monospace"><Group DEF='not illuminated'></font></div><div><font face="monospace, monospace">....</font></div><div><font face="monospace, monospace"></Group></font></div><div><br></div><div>Yes, I think that would work in principle. How do you get the counter-rotation of the rotation output of a SphereSensor within x3d ? With a x3d script which negates the amount of rotation but retains the axis ? </div><div>[To counter a GeoLocation transform a more general inverse of a full transformation matrix needs to be derived since both translation and rotation is involved.] </div><div>While this would work, it feels to me more like a work around than a proper solution. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Or would having a transform around the shape cause the light to not find its local geometry in the browser of your choice?<br></blockquote><div><br></div><div>The browser I am mostly interested in is x3dom but the choice should not matter too much. x3dom does not support light scoping and x3d scripting.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Do you have a sample scene?<br></blockquote><div><br></div><div><span style="color:rgb(0,0,0);font-size:12.8000001907349px">I wanted to use light scoping here:</span></div><div><br></div><div><a href="http://andreasplesch.github.io/x3dom/GeoElevationGrid_texture/terrain_spheresensor.xhtml">http://andreasplesch.github.io/x3dom/GeoElevationGrid_texture/terrain_spheresensor.xhtml</a></div><div><br></div><div>in order to quickly compare the effects of different kinds of shading.</div><div><br></div><div>-Andreas</div></div>
</div></div>