[X3D-Public] Libraries for X3D

Iñaki Prieto Furundarena prieto.inaki at gmail.com
Thu Apr 12 23:51:11 PDT 2012


Hi Felipe,



The first problem is about TouchSensor.



I have the following X3D main file:

<?xml version='1.0' encoding='UTF-8'?>

<X3D profile='Interactive' version='3.2'>

                <Scene>

                               <Group>

                                               <Transform>

                                                               <Inline
DEF="1-ClosureSurface-2-Desktop" url="1-ClosureSurface-2-Desktop.x3d" />

                                                               <TouchSensor
DEF="TouchSensor-1-ClosureSurface-2-Desktop" />

                                               </Transform>

                                               <Transform>

                                                               <Inline
DEF="2-ClosureSurface-2-Desktop" url="2-ClosureSurface-2-Desktop.x3d" />

                                                               <TouchSensor
DEF="TouchSensor-2-ClosureSurface-2-Desktop" />

                                               </Transform>

                                               <Transform>

                                                               <Inline
DEF="2-WallSurface-2-Desktop" url="2-WallSurface-2-Desktop.x3d" />

                                                               <TouchSensor
DEF="TouchSensor-2-WallSurface-2-Desktop" />

                                               </Transform>

                               </Group>

                </Scene>

</X3D>



Xj3D visualizes the geometry of the 3 inlines correctly. However, the
problem is that the TouchSensor node works when it wants.


I have the following code where I enable all TouchSensor:

…

NodeList listOfTouchSensor = doc.getElementsByTagName("TouchSensor");



             *for* (*int* i = 0; i < listOfTouchSensor.getLength(); i++) {

                    String nombreTouchSensor = listOfTouchSensor.item(i)

                                  .getAttributes().getNamedItem("DEF"
).getNodeValue();



                    X3DNode touch = *mainScene*
.getNamedNode(nombreTouchSensor);

                    *if* (touch == *null*) {

                           System.*out*.println("Couldn't find TouchSensor
named: "

                                        + nombreTouchSensor);

                           *return*;

                    } *else* {

                           System.*out*.println("Sensor: " +
nombreTouchSensor);

                    }

                    SFTime ttime = (SFTime) touch.getField("touchTime");

                    ttime.setUserData(nombreTouchSensor.split("-")[1]);

                    ttime.addX3DEventListener(miXJ3DPanel);





             }



…



       *public* *void* readableFieldChanged(X3DFieldEvent evt) {

             X3DField *src* = (X3DField) evt.getSource();

             System.*out*.println("Stop touching me!");

             System.*out*.println(evt.getData().toString());

       }





Sometimes all TouchSensor works fine. But in most cases one or two of them
can’t be touched, the mouse icon doesn’t change to the TouchSensor icon. I
tried also putting one TouchSensor node for all Inlines and happen the same.



Have you had this problem before?





The other problem is that I need some functionality and reading the
documentation I didn’t find it.

I need the methods to know the current viewpoint, the viewing frustum,
projection matrix, etc.

In the same way it is possible to select an area of the model using a
bounding box?





I have many issues.



Thanks in advance



Best regards

On 12 April 2012 22:06, Felipe Bacim <fbacim at vt.edu> wrote:

> Iñaki,
>
> we've been using Xj3D with SAI for quite a while here at Virginia Tech. Is
> there anything specific you need to do that you can't do with Xj3D?
>
> Felipe
>
> On Thu, Apr 12, 2012 at 9:43 AM, Iñaki Prieto Furundarena <
> prieto.inaki at gmail.com> wrote:
>
>> Hi all,
>>
>>
>> What is the best library to implement applications that load and
>> manipulate X3D files in Java?
>>
>> I tried with Xj3D and CyberX3D. Is there any other?
>>
>>
>>
>> Thanks in advance
>>
>>
>>
>> Best regards
>>
>> --
>> Iñaki Prieto Furundarena
>>
>>
>> _______________________________________________
>> X3D-Public mailing list
>> X3D-Public at web3d.org
>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>
>>
>


-- 
Iñaki Prieto Furundarena
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20120413/146d863f/attachment-0001.html>


More information about the X3D-Public mailing list