You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After loading gltf, the model keeps displaying vertically. Adjusting rotateZ, rotateY, and rotateX does not take effect. How can I quickly make the model display horizontally on the ground and adjust the horizontal angle
Your Environment
Version used:2.44.2
Browser Name and version:
code
`const loader = new GLTFLoader3D()
const dracoloder = new DRACOLoader()
dracoloder.setDecoderPath('/draco/')
loader.setDRACOLoader(dracoloder)
// 开始加载
loader.load('/model5.glb', (gltf) => {
const model = gltf.scene
// building coordinate
const coord = new itowns.Coordinates(
'EPSG:4326',
113.249257,
28.408089,
0
)
console.log(coord.as(view.referenceCrs))
model.position.copy(coord.as(view.referenceCrs))
// *********************************************************
// align up vector with geodesic normal
model.lookAt(model.position.clone().add(coord.geodesicNormal))
model.rotateZ(-Math.PI / 2)
// *********************************************************
model.scale.set(100, 100, 100)
// update coordinate of the mesh
model.updateMatrixWorld()
view.scene.add(model)
view.notifyChange()
})
`
The text was updated successfully, but these errors were encountered:
After loading gltf, the model keeps displaying vertically. Adjusting rotateZ, rotateY, and rotateX does not take effect. How can I quickly make the model display horizontally on the ground and adjust the horizontal angle
Your Environment
code
`const loader = new GLTFLoader3D()
const dracoloder = new DRACOLoader()
dracoloder.setDecoderPath('/draco/')
loader.setDRACOLoader(dracoloder)
// 开始加载
loader.load('/model5.glb', (gltf) => {
const model = gltf.scene
// building coordinate
const coord = new itowns.Coordinates(
'EPSG:4326',
113.249257,
28.408089,
0
)
console.log(coord.as(view.referenceCrs))
model.position.copy(coord.as(view.referenceCrs))
`
The text was updated successfully, but these errors were encountered: