<div dir="auto">Interesting ideas, Andreas, I didn’t realize there was a ColorInterpolator, Thanks!</div><div dir="auto"><br></div><div dir="auto">John</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 7, 2024 at 12:02 PM Andreas Plesch via x3d-public <<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">It would be difficult to do without a script.<br>
<br>
But one way may be to have one ColorInterpolator per color (only way<br>
to generate SFColor out events), and one Timesensor per color (to<br>
generate fraction events to trigger the color events), all disabled<br>
initially. (Actually, one set of such pairs for each Cylinder).<br>
<br>
Then enable the Timesensor which corresponds to the selected color on<br>
the color bar, and disable all others. Probably via Touchsensor on<br>
each color square and routing isActive and negated isActive through<br>
BooleanFilter to the Timesensors (lots of Routes, colors squared or<br>
so.)<br>
<br>
Then route touchTime from the cylinder Touchsensors to startTime (and<br>
perhaps stopTime, for one-time triggering) to all Timesensors for the<br>
Cylinder. Only the enabled Timesensor would trigger SFColor out from<br>
the associated ColorInterpolator.<br>
<br>
Then route all ColorInterpolators (for the specific Cylinder) to all<br>
Materials. To make this idea work, actually separate sets of<br>
ColorInterpolator/Timesensor pairs would be needed per individual<br>
Cylinder.<br>
<br>
So this might work but needs very many nodes and routes. On the other<br>
hand the scripts also need lots of functions.<br>
<br>
<br>
There may be another way based on Switch nodes, and having predefined<br>
Shapes per color. So given n colors, each Cylinder is a Switch with n<br>
Shapes. Then touching a cylinder, selects a color based on a<br>
IntegerTrigger node (per Switch).<br>
<br>
The IntegerTrigger nodes are reconfigured (set_integerKey) when a<br>
color square is selected. I think this can be done via a<br>
IntegerSequencer which gets a fraction from a ScalarInterpolator (per<br>
color) with a single keyValue, which is fed from a Timesensor which<br>
can be triggered from a Touchsensor on the color square.<br>
<br>
The piece missing is that reconfiguration also generates triggerValue<br>
out which would be routed to the Switch nodes which is not wanted<br>
then. Not sure how to solve this, I could not think of a way.<br>
<br>
Some ideas, -Andreas<br>
<br>
<br>
> Message: 1<br>
> Date: Fri, 4 Oct 2024 14:08:10 -0500<br>
> From: John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>><br>
> To: X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
> Subject: [x3d-public] Improve my example? No scripts?<br>
> Message-ID:<br>
>         <CAGC3UEmtY=<a href="mailto:6GjARK%2BTaQy3HU9FCJrHZgbhe7Zn0mdVafEUoKYQ@mail.gmail.com" target="_blank">6GjARK+TaQy3HU9FCJrHZgbhe7Zn0mdVafEUoKYQ@mail.gmail.com</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
><br>
> Can this be done without scripts so i can use castle-model-viewer?<br>
><br>
> <a href="https://github.com/coderextreme/JSONverse/blob/main/public/x3d/symbols3d.x3d" rel="noreferrer" target="_blank">https://github.com/coderextreme/JSONverse/blob/main/public/x3d/symbols3d.x3d</a><br>
><br>
> If not, can we extend the standard?<br>
><br>
> Thanks!<br>
><br>
> John<br>
<br>
<br>
-- <br>
Andreas Plesch<br>
Waltham, MA 02453<br>
<br>
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div></div>