Replies: 3 comments
-
It's also good to note that some UI Begin/End pairs also contain their own calls to For example, in Unity you might have a GameObject hierarchy like this:
To recreate this using Hierarchy.Push/Pop with StereoKit: Hierarchy.Push(playerTransform);
Hierarchy.Push(headTransform);
Hierarchy.Push(sunglassesTransform);
sunglassModel.Draw(Matrix.Identity);
Hierarchy.Pop();
Hierarchy.Pop();
Hierarchy.Push(handTransform);
Hierarchy.Push(swordransform);
Hierarchy.Pop();
Hierarchy.Pop();
Hierarchy.Pop(); |
Beta Was this translation helpful? Give feedback.
-
@maluoi Thanks for the response. I went down the path of totally unstructured "objects", for lack of a better word. My platform maintains an in-memory graph of everything it draws. I purposefully keep the graph very shallow trying to avoid the Unity style hierarchy. I think, at least to me, the SK immediate render/draw (whatever) is one of its most attractive and powerful features. It does come with trade-offs, SK draws what I want, where I want it - immediately! It is entirely my job to tell it what to draw and when. |
Beta Was this translation helpful? Give feedback.
-
@maluoi by the way, on the moving my box and all its content problem. I went back and redesigned the graph somewhat so that it adjusts the "roots" of things. By doing this, on the next frame draw the SK simply has a different Pose or position/rotation and is none the wiser. |
Beta Was this translation helpful? Give feedback.
-
Never really used the Hierarchy.Push/Pop. I think that I might have a use case for it but so far baffled by how it works. I've read the docs a dozen times, and it all seems to make sense, but it doesn't work as I expected it to. So I have a collection of UI.HandleBegin "things" that each enclose meshes and models that I am drawing. They are all independent since I have no Hierarchy defined. I need to be able to move the whole collection to another location on startup to correct for where the user is and where he is looking when it first starts the app. Ideally, I want to move the scene to a known location on start up.
I thought that "wrapping" them all in a Hierarchy would allow me to adjust their pose positions without changing them individually. Am I misunderstanding the use of the Hierarchy?
Beta Was this translation helpful? Give feedback.
All reactions