[X3D-Public] ROUTEs can send an event to a point in the 3D space?
diego martínez
diegomp1982 at gmail.com
Fri Aug 21 13:49:33 PDT 2009
"Does this help?
http://www.web3d.org/x3d/wiki/index.php/Collision"
This node simply detects the collision between the avatar and any object in
the VE.
Regarding this other solution you told me:
"However it sounds like you can do this by simply watching the PlaneSensor
output in a Script. When the desired location is reached do your add/remove
ROUTES. No SAI needed."
This solution could do the job. I could connect both the output of the
'plug' PlaneSensor and the output of the 'bulb' PlaneSensor to the same
script. If the distance between both positions is smaller than a given
radius -a 'sphere' collision detection-, the collision could be detected and
the behaviour executed.
The only problem is that I wanted to have several bulbs and other gadgets,
so they are going to be quite a lot of scripts. And the number will explode
if I want to add more than one 'plug'. Also, I would have liked to be able
to PROTOtype the bulbs and their associated scripts, but it seems it is
going to be hard to do...
There is not an easier way? No generic way to detect a collision? No way to
send an event to a position in the space so that it stimulates any object in
that position? Maybe there are things I have not seen in the X3D
specification...
Cheers!
El 21 de agosto de 2009 22:32, diego martínez <diegomp1982 at gmail.com>escribió:
> That does not solve my problem, but thanks anyway for the advice!
>
> I will try to explain myself better. I have an object (the 'plug')
> connected with a ROUTE to an on/off button. What I want to do is that, when
> I move another object (i.e. a bulb) over the plug, that object will react
> (i.e. the bulb would start shinning). Both the 'plug' and the 'bulb' should
> be movable.
>
> An event telling when two objects collide (so that I could check when the
> 'bulb' collides the 'plug') would solve it. Otherwise I cannot think of a
> ECMAscript that solved this issue...
>
> The second solution is implementing my own SceneGraph in java, keeping the
> current positions of the objects (bulb and plug) and perform the collision
> detection on my own.
>
> If X3D ROUTEs could send events to a position in the space, so that they
> stimulated any object located in that position, the problem would be easily
> solved...
>
> Thanks!
>
> El 21 de agosto de 2009 21:51, Joe D Williams <joedwil at earthlink.net>escribió:
>
> You can add/remove routes using SAI script.
>> Otherwise I don't quite understand what you are trying to do.
>> Best Regards,
>> Joe
>>
>> ----- Original Message ----- From: "diego martínez" <
>> diegomp1982 at gmail.com>
>> To: <x3d-public at web3d.org>
>> Sent: Friday, August 21, 2009 3:15 AM
>> Subject: [X3D-Public] ROUTEs can send an event to a point in the 3D space?
>>
>>
>>
>> Hello everybody!
>>>
>>> This is my first message to the list, even though I have some experience
>>> using the good old VRML.
>>>
>>> I would like to add a plug in a Virtual Environment (VE), so that any
>>> object
>>> placed over the plug (collision) would receive events to turn it on or
>>> off.
>>>
>>> My initial idea was to define prototypes with a boolean input field for
>>> the
>>> different objects (bulbs, toys,...) I wanted to plug. These objects would
>>> be
>>> moved over a table using a PlaneSensor. Then I would connect a button
>>> with a
>>> TouchSensor that would send its events to the position of the 'plug' in
>>> the
>>> 3D space. I would like this plug to be also movable using a PlaneSensor.
>>>
>>> Unluckily, after checking X3D specification, I think this approach is not
>>> possible.
>>>
>>> How could I implement such a behaviour in X3D?
>>> I have tried to create an script executed by the objects likely to be
>>> connected to the plug, in which I would manually check the collision
>>> among
>>> these objects, but I would need to get the 3D position of both the plug
>>> and
>>> the object. Is there any way to do this?
>>>
>>> Would I need to use SAI and have a parallel SceneGraph -an external java
>>> SceneGraph- definition that allows me to check such things??
>>>
>>> Thanks in advance!!
>>>
>>>
>>
>>
>> --------------------------------------------------------------------------------
>>
>>
>> _______________________________________________
>>> X3D-Public mailing list
>>> X3D-Public at web3d.org
>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20090821/0465c5a3/attachment-0001.html>
More information about the X3D-Public
mailing list