SGC and setGeometry Questions

Have jReality programming problems or questions? Post them here.
Post Reply
Dylan C
Posts: 1
Joined: Thu 12. Mar 2015, 05:13

SGC and setGeometry Questions

Post by Dylan C » Thu 12. Mar 2015, 05:28

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!

Andre
Posts: 226
Joined: Fri 18. Sep 2009, 11:30

Re: SGC and setGeometry Questions

Post by Andre » Mon 4. May 2015, 16:15

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);

Post Reply