I am starting with jReality and want to use it within a view of a RCP-application. To introduce not more dependencies than really needed i use a stripped down version - backends.share, core, io, jogl, swt, tool and antlr.
I experience problems with the JOGL rendering on my laptop with onboard Intel GM45 running under Ubuntu 9.10 64bit:

or:

Produce by this minimal code:
Code: Select all
SwtViewer viewer = new SwtViewer(canvas);
JrScene scene = JrSceneFactory.getDefaultDesktopScene();
SceneGraphComponent contentNode = scene.getPath("emptyPickPath").getLastComponent();
viewer.setSceneRoot(scene.getSceneRoot());
viewer.setCameraPath(scene.getPath("cameraPath"));
//IndexedFaceSet ifs = Primitives.icosahedron();
IndexedFaceSet ifs = Primitives.coloredCube();
contentNode.setGeometry(ifs);
// center and scale the content
Rectangle3D bds = BoundingBoxUtility.calculateBoundingBox(contentNode);
double[] ext = bds.getExtent();
double objectSize = Math.max(Math.max(ext[0], ext[1]), ext[2]);
double[] center = bds.getCenter();
MatrixBuilder mb = MatrixBuilder.euclidean();
mb.scale(targetObjectSize/objectSize);
mb.translate(-center[0], -center[1], -center[2]);
Matrix newMatrix = mb.getMatrix();
newMatrix.assignTo(contentNode);
Have i missed something important?
I have tested different variations including switching over to current JOGL 2.0beta10. If someone has a hint, or i can provide more information, please answer!
Thanks, Mario.