Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-parenting ? #12

Open
andreasplesch opened this issue May 17, 2019 · 3 comments
Open

multi-parenting ? #12

andreasplesch opened this issue May 17, 2019 · 3 comments

Comments

@andreasplesch
Copy link

As far as I can see, the scene graph allows for exactly one parent for each node, as most do. Is that correct ?

I was looking at how litescene.js could work with X3D (VRML) for import/export or as a player. X3D (and SVG) have a concept of (DEF) nodes with can be reused as USE nodes elsewhere in the graph. They are placed not as copies or clones but just exist in multiple places, and therefore can have multiple parents.

Could such multi-parenting be simulated with components or prefabs ?

Instancing is similar but in X3D the DEF/USE concept applies to any node.

For importing and playing one could just make clones, I suppose. Do the clones keep a relationship with their originals ?

@jagenjo
Copy link
Owner

jagenjo commented May 17, 2019

THe problem is that the system wasnt designed with that purpose in mind so it would imply to rework lots of parts to work that way.

But you can always develop a X3D component that inside has all the X3D features and co-live with my own system. Then when my system sends a message to the component it could redirect it to wherever.

@andreasplesch
Copy link
Author

Ok, I think I can see the idea. Manage the X3D scene inside a component but still use things like primitives or materials or Transforms or renderers from litescene. Can these be used outside of a SceneNode ? Or can a SceneNode be used outside of a Scene ?

How would one set up another scene type ? I guess I should look at
https://github.com/jagenjo/litescene.js/blob/master/src/scene.js

@andreasplesch
Copy link
Author

https://github.com/jagenjo/litescene.js/blob/master/src/scene.js#L1770 looks like prefabs instances are references to the same prefab.
https://github.com/jagenjo/litescene.js/blob/master/guides/prefabs.md
So this is pretty close but I guess prefabs are supposed to be static, eg. should not/can not be modified during playing ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants