Creating a proxy scene graph

Have jReality programming problems or questions? Post them here.
Post Reply
User avatar
gunn
Posts: 323
Joined: Thu 14. Dec 2006, 09:56
Location: TU Berlin
Contact:

Creating a proxy scene graph

Post by gunn » Thu 24. Nov 2011, 11:24

I have two different applications in which I need to take a scene graph and process it to create a second scene graph which is identical except that the geometry of the first has undergone a transformation of some kind. In the first case, I want to dualize a scene graph in the sense of projective geometry; in the second I want to convert the projective model of hyperboklic geometry to the conformal model. Appearances and transformations may also have to be adjusted in the process.

I've written my own SceneGraphVisitor to do this (proof of concept) but it's not instrumented to respond to changes in the original scene graph, i. e., it doesn't stay up-to-date. I have the idea that the classes in the package de.jreality.scene.proxy might be what I need but am not sure how to proceed. Anyone have any pointers?
jReality core developer

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Re: Creating a proxy scene graph

Post by steffen » Thu 24. Nov 2011, 18:29

Charles, look into src-proxies/de.jreality.scene.proxy.smrj The class SMRJMirrorFactory would be replaced in your case by a simple visitor that creates shallow copies of SceneGraphNodes (just use SceneGraphUtility.copy for all except SceneGraphComponents), except for the geometries you want to share. SMRJSceneGraphSynchronizer attaches/detaches listeners and updates the copies. In your case you would update the transformations/appearances of the copy. finally, SMRJMirrorScene makes use of the other classes to create the copy, you will need something similar.

Let me know how it is going...

Steffen

Post Reply