import-bot (20211) [Avatar] Offline
#1
[Originally posted by jacv]

Hi!

Has anyone used the vrml loaders by the vrml-j3d group? I used the
SimpleViewer class found in the examples.

With that, I have used the VrmlLoader, and Scene classes.And it goes by:

1) Instantiating an object of type Vrmlloader
2) load the VRML file and put the scene in to a declared scene object
3) Get the BranchGroup of the Scene object
4) Add the obtained Branchgroup to a transformgroup and then add this
transformgroup to the main branchgroup where all geometry and viewplatform
objects are its children.

I have a sensor that modifies the parent transformgroup of the current
viewplatform.This is done by the click of a button.

But everytime I press the button, the view translate (which is OK) the object
also moves but the sensor has no reference to the object.

The Loader example of Java3D (The one that morphs hands) uses and Lightwave
format that loads the file and gets the scence from it and then gets the
branchgroup.

The first child of the Branchgroup is obtained and then converted into a
geometry array object and is then stored in a shape3d object.

Is it the same for VRML?I hope someone can help me.... smilie

Thanks!


Jonathan
import-bot (20211) [Avatar] Offline
#2
Re: VRML Loaders!
[Originally posted by author]

The approach you describe for getting the root branch group from the scene
sounds correct. If your object is contained in a subgraph of the scenegraph
then all you need is the root group of that subgraph, not the geometry array.
When you say your sensor doesn't have a reference to the object, do you mean
to the object you loaded or the transform group you are using to manipulate
that object in the scene?

--jon

> Hi!
>
> Has anyone used the vrml loaders by the vrml-j3d group? I used the
> SimpleViewer class found in the examples.
>
> With that, I have used the VrmlLoader, and Scene classes.And it goes by:
>
> 1) Instantiating an object of type Vrmlloader
> 2) load the VRML file and put the scene in to a declared scene object
> 3) Get the BranchGroup of the Scene object
> 4) Add the obtained Branchgroup to a transformgroup and then add this
> transformgroup to the main branchgroup where all geometry and viewplatform
> objects are its children.
>
> I have a sensor that modifies the parent transformgroup of the current
> viewplatform.This is done by the click of a button.
>
> But everytime I press the button, the view translate (which is OK) the object
> also moves but the sensor has no reference to the object.
>
> The Loader example of Java3D (The one that morphs hands) uses and Lightwave
> format that loads the file and gets the scence from it and then gets the
> branchgroup.
>
> The first child of the Branchgroup is obtained and then converted into a
> geometry array object and is then stored in a shape3d object.
>
> Is it the same for VRML?I hope someone can help me.... smilie
>
> Thanks!
>
>
> Jonathan
import-bot (20211) [Avatar] Offline
#3
Re: VRML Loaders!
[Originally posted by jacv]

Hi! I am sorry for not being able to reply to you sir! The problem did not lie
in the code but in the 3d modeller. From what I experienced, the 3d object
should sit on the (0,0,0) location or else it will really mode. It is ture
that the code did not contain any mistakes!

Thanks!

Joanthan

> The approach you describe for getting the root branch group from the scene
> sounds correct. If your object is contained in a subgraph of the scenegraph
> then all you need is the root group of that subgraph, not the geometry array.
> When you say your sensor doesn't have a reference to the object, do you mean
> to the object you loaded or the transform group you are using to manipulate
> that object in the scene?
>
> --jon
>
> > Hi!
> >
> > Has anyone used the vrml loaders by the vrml-j3d group? I used the
> > SimpleViewer class found in the examples.
> >
> > With that, I have used the VrmlLoader, and Scene classes.And it goes by:
> >
> > 1) Instantiating an object of type Vrmlloader
> > 2) load the VRML file and put the scene in to a declared scene object
> > 3) Get the BranchGroup of the Scene object
> > 4) Add the obtained Branchgroup to a transformgroup and then add this
> > transformgroup to the main branchgroup where all geometry and viewplatform
> > objects are its children.
> >
> > I have a sensor that modifies the parent transformgroup of the current
> > viewplatform.This is done by the click of a button.
> >
> > But everytime I press the button, the view translate (which is OK) the
object
> > also moves but the sensor has no reference to the object.
> >
> > The Loader example of Java3D (The one that morphs hands) uses and Lightwave
> > format that loads the file and gets the scence from it and then gets the
> > branchgroup.
> >
> > The first child of the Branchgroup is obtained and then converted into a
> > geometry array object and is then stored in a shape3d object.
> >
> > Is it the same for VRML?I hope someone can help me.... smilie
> >
> > Thanks!
> >
> >
> > Jonathan