Comments (6)
This should be in the readme as technical documentation.
from gltfscenekit.
Given its been almost a year since this issue has been opened without much response from @magicien ... whomever else is running into this issue, please check out my fork. I fixed the node structure issue. In the fork below, the scene graph in SceneKit is a 1:1 match of the structure of the GLB and doesn't distort the scene hierarchy with arbitrary nodes in the way this library does.
https://github.com/digitallysavvy/GLTFSceneKit
from gltfscenekit.
I mapped each node/mesh/primitive onto SCNNode, so WaterBottleEmptyNode is mapped onto mesh.
Actually, mesh SCNNode doesn't have any 3D data. It has only 'name'.
It's possible to omit mesh nodes, but it could be confusing if child nodes and primitive nodes are in the same layer.
How do you think?
from gltfscenekit.
What do you mean exactly?
From what I understand the primitives are part of the mesh object. which point to indices and materials. but mesh[0] defines a mesh with geometry and materials. so I see it more confusing to interpret that as
WaterBottle -- start of gltf asset
-WaterBottleEmptyNode -- mesh[0] object, but its an empty container
-WaterBottleMesh -- primitives of mesh[0], contains Normal, UV, Position, Tangent info
than
WaterBottle -- start of gltf asset
-WaterBottleMesh -- mesh[0] object, + primitives: UV, Normal, Position, Tangent info.
SCNNode is capable of having the format be this way and it would be less confusing to work with the nodes this way
here's a screenshot of the babylon js inspector ( __root would be what we are calling WaterBottle) and then the only child node is WaterBottle.
edit: and the child nodes of these meshes could just be children of the base mesh
WaterBottle -- start of gltf asset
-WaterBottleMesh -- mesh[0] object, + primitives: UV, Normal, Position, Tangent info.
-WaterBottleChild1
-WaterBottleSiblingNode
from gltfscenekit.
Thank you for your explanation!
Current mapping between glTF and SceneKit looks like this:
I don't think I can change the mapping into this way because SCNNode can have only one geometry. I'm not sure, but I think if SCNGeometry has 2 or more vertex SCNGeometrySources, SceneKit will use only the first source.
This is possible, but I'm worried about putting primitives and children nodes in the same layer could be confusing.
from gltfscenekit.
Bump on this issue because I ran into problems with the node hierarchy.
The issue with the extra nodes is the duplication of names and it forces the developer to write a nasty work-around.
The issue really becomes apparent when you use the childNodeWithName
because the method returns the first instance of a node with this name, but with the given hierarchy that node is not the one I'm looking for but instead an arbitrary parent. To get the node I am looking for I then have to call childNodeWithName
again and then use childNodes.first
to get the node with the geometry I wish to affect.
This is a headache for anyone trying to do anything as simple as change a material.
I have opened a PR (#37) that addresses this issue.
@magicien I know you have some reservations about changing this structure so I'd like to find a resolution that works for all because as the current version stands this is a major hinderance to simple traversals for named nodes.
from gltfscenekit.
Related Issues (20)
- Can this be ported to RealityKit? HOT 1
- Custom vertex property
- Adding local UV maps
- Loading options are ignored
- Support for Lines, Point and other primitive Types
- Does this work for .glb files? HOT 2
- KHR_draco_mesh_compression
- run sample code and getting empty blank screen HOT 2
- Animations for GLB in iOS
- Add shadow to AR object
- shader compile error on Xcode 13
- Joints_2 and Weights_2
- The model is stretched when Load the glb with animations HOT 1
- Glb Morph target?
- Not working if Access .gltf file via url HOT 1
- Samples error when i load .glb with shape key animation
- Glb with animations is not working HOT 1
- How to trigger a specific animation in glb HOT 3
- My model shows a white texture
- Texture quality. How to get better ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gltfscenekit.