Page 1 of 1

SGC and setGeometry Questions

Posted: Thu 12. Mar 2015, 05:28
by Dylan C
Hello,

I'm very new to jReality and working with 3D graphics all together. I am working on a project in jReality and I'm having some difficulties learning some things.

My project will take place in a VR space, so I'm using JRViewer. I'm curious as to what the difference is between:

Code: Select all

SceneGraph Component sgc = new SceneGraphComponent();
SceneGraphComponent sgc_SGU = SceneGraphUtility.createFullSceneGraphComponent("Something");
in addition to this,

why is this legal?:

Code: Select all

sgc.setGeometry(Primitives.cylinder(5));
and this is not:

Code: Select all

sgc.setGeometry(Primitives.sphere(5.0,0.0,0.0,0.0));
Thank you in advanced!

Re: SGC and setGeometry Questions

Posted: Mon 4. May 2015, 16:15
by Andre
Primitives.sphere(something) gives you a ScenegraphComponent.
Primitives.cylinder and geometry.

a SceneGraphComponent can have a geometry.

The difference is:

Code: Select all

SceneGraphComponent sgc = new SceneGraphComponent();
SceneGraphComponent sphere = Primitives.sphere(something);
sgc = sphere;

Code: Select all

SceneGraphComponent sgc = new SceneGraphComponent();
IndexedFaceSet geometry = Primitives.cylinder(something);
sgc.setGeometry(geometry);