[x3d-public] setting TouchSensor DEF in initialize() and adding a ROUTE doesn't work
Holger Seelig
holger.seelig at yahoo.de
Fri Jan 3 14:20:13 PST 2025
I do not suggest any of these functions, but they are well specified in the standard. Have a look at the following link:
https://www.web3d.org/documents/specifications/19777-1/V3.3/Part1/functions.html
Holger
--
Holger Seelig
Leipzig, Germany
holger.seelig at yahoo.de
https://create3000.github.io/x_ite/
> Am 03.01.2025 um 18:22 schrieb John Carlson <yottzumm at gmail.com>:
>
> Holger suggests:
> function initialize() {
> var touchSensor = Browser.currentScene.createNode('TouchSensor');
> Browser.currentScene.addNamedNode("FOOBAR", touchSensor);
> }
>
> And
>
> console.log(touchSensor.getNodeName())
>
> I hope to generate a bunch of examples using these.
>
>
> This is a warmup!
>
> Thanks, Holger!
>
> John
>
>
> On Thu, Jan 2, 2025 at 11:09 PM John Carlson <yottzumm at gmail.com <mailto:yottzumm at gmail.com>> wrote:
>> I'm trying to achieve a large checkbox menu, with animations on the X axis and body parts on the Y axis, plus a row for all body parts for convenience.
>>
>> (sorry, large image)
>>
>> <image.png>
>>
>> My guess is that a PROTO with ProtoInstance code generation will be the best way to achieve this (no, I don't want to type all that in)!
>>
>> Source code is available for interested parties.
>>
>> It would be OK, if people told me to do this in HTML, but I would probably switch to X_ITE or X_ITE vscode.
>>
>> John
>>
>> On Thu, Jan 2, 2025 at 10:47 PM John Carlson <yottzumm at gmail.com <mailto:yottzumm at gmail.com>> wrote:
>>> I want to use a TouchSensor in a ROUTE that I am adding in Sunrize ECMAScript (SAI, embedded scripts), but I can't seem to set the DEF, so I can't really add the ROUTE.
>>>
>>> I can't use createX3DFromString(), perhaps, because I might not be able to access DEF to get the DEF value. I don't have experience using the result from createX3DFromString().
>>>
>>> I am creating TouchSensors in a double loop, and it appears the only way to do it is with code generation.
>>>
>>> Hmm. AFAIK, setting DEF is super simple in Java and Python, especially in DOM.
>>>
>>> I don't really feel like code generation is reasonable, because I will have to rewrite my code.
>>>
>>> This is where I through my hands up and use something like raylib or HTML.
>>>
>>> Using a PROTO might be much more reasonable.
>>>
>>> John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250103/6d24e84d/attachment.html>
More information about the x3d-public
mailing list