-
Notifications
You must be signed in to change notification settings - Fork 303
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
examples(Glb): load a glb on 3D map #2155
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution :)
You can upload your glb asset to the following repository by opening a new PR: https://github.com/iTowns/iTowns2-sample-data (along with a license file and if its license allows it).
Can you add a functional test in test/functional please? (all itowns examples are tested in functional tests so we easily detect issues). A minimal test is to check that it runs (like here). Other ideas of tests are to check if the model has been correctly added in the scene and to pick into the scene to check if the model is displayed at the correct coordinates.
Hi, thanks for this new example. Also, if that's ok for @LoicUTC and @PhilippeMarc-IGN, could you rename your example to something like |
object = model; | ||
const boundingBox = new THREE.Box3(); | ||
boundingBox.setFromObject(object); | ||
const center = boundingBox.getCenter(new THREE.Vector3()); | ||
|
||
object.position.x += object.position.x - center.x; | ||
object.position.y += object.position.y - center.y; | ||
object.position.z += object.position.z - center.z; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove these lines.
Hi @Exareyn, are you still active on this subject? Are you able to implement the last modifications asked in the review? Can we help you in any way for doing them? |
Description
Add an example demonstrating how to load a glb (glTF binary) model on a 3D Map
Motivation and Context
I needed a way to load any glb into a 3D Map and the only existing example merged recently that i found didn't really worked with any glb. So I made this example that should work with every glb. Hope it helps other people who need something like this too.
#2129 (comment)
This is what I got using the example I found after using it with different glb :
Changes Made
Created a new example file named "itowns_glb.html".
The example should load a glb like in the next screen :
If something is wrong or need to be updated let me know. I'm also working on a glTFLayer to make it easier to create and load a glb anywhere but it is not ready yet.
And I don't know where I should push my glb asset used on the screens for testing if it's needed.
This was made during an intership at Futurmap