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

Unable to render parts correctly from a gltf model. #1

Closed
Gauzz opened this issue Mar 28, 2021 · 3 comments
Closed

Unable to render parts correctly from a gltf model. #1

Gauzz opened this issue Mar 28, 2021 · 3 comments

Comments

@Gauzz
Copy link

Gauzz commented Mar 28, 2021

I am trying to render a phonebooth model with separate parts using gltf-part-plus.

Although all the parts of the model seem to be rendering fine the position and orientation are not correct. Can someone please help me with this?

Here is the image of how the entire model is

phoneboothModel

Here is how it looks like after using gltf parts

PhoneboothParts

The position, rotation and scale of the object are coming from the backend in json format and the unity client is able to read and render it without any issue. Only Aframe is having a problem.

@kfarr
Copy link
Owner

kfarr commented Mar 29, 2021

@Gauzz unfortunately the implementation in this repo to split the gltf into parts is pretty naive and not tested against a wide range of objects. I welcome your debugging to fit your use case, or you might want to check out this project which is much more robust and offers similar utility for react-three-fiber:
https://github.com/pmndrs/gltfjsx

@Gauzz
Copy link
Author

Gauzz commented Apr 3, 2021

Thanks for the reply @kfarr will look into the repo you have shared. Although I am fairly new to the 3d myself but will try to contribute if possible.

@kfarr
Copy link
Owner

kfarr commented Nov 2, 2021

Hi @Gauzz , I have updated the documentation for the resetPosition property to indicate it is not well tested:

For the first gltf node encountered in the matching part, copy its translation to the a-frame entity, and then set gltf translation to 0 0 0. This keeps the same world position for the placed gltf part's first node, while giving the A-Frame entity the value of that part from the gltf scene. However, this only works for a simple gltf with only 1 child node for each part in the scene. (Use with caution, this is not a well-tested property and might not work as expected on your model.)

I'll mark this closed for now, but feel free to open again if needed.

@kfarr kfarr closed this as completed Nov 2, 2021
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