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
After adding the mesh of the gltf model to THREE.InstancedMesh, I modified the scaling, and the rendered effect seems to have lost some vertices
loader.load( "https://threejs.org/examples/models/gltf/Flower/Flower.glb", function (gltf) { const p = projectToWorld(origin); const model = gltf.scene; const _stemMesh = model.getObjectByName("Stem"); const _blossomMesh = model.getObjectByName("Blossom"); const stemGeometry = _stemMesh.geometry.clone(); const blossomGeometry = _blossomMesh.geometry.clone(); const stemMaterial = _stemMesh.material; const blossomMaterial = _blossomMesh.material; const stemMesh = new THREE.InstancedMesh( stemGeometry, stemMaterial, 1 ); const blossomMesh = new THREE.InstancedMesh( blossomGeometry, blossomMaterial, 1 ); stemMesh.instanceMatrix.setUsage(THREE.DynamicDrawUsage); blossomMesh.instanceMatrix.setUsage(THREE.DynamicDrawUsage); const defaultTransform = new THREE.Matrix4() .makeRotationX(Math.PI) .multiply(new THREE.Matrix4().makeScale(1, 1, 1)); stemGeometry.applyMatrix4(defaultTransform); blossomGeometry.applyMatrix4(defaultTransform); stemMesh.instanceMatrix.needsUpdate = true; blossomMesh.instanceMatrix.needsUpdate = true; const dummy = new THREE.Object3D(); let pos = projectToWorld([118.61113, 32.06318, 0]); for (let i = 0; i < 1; i++) { dummy.position.copy(pos); dummy.scale.set(10, 10, 10); // dummy.scale.set(100, 100, 100); dummy.updateMatrix(); stemMesh.setMatrixAt(i, dummy.matrix); blossomMesh.setMatrixAt(i, dummy.matrix); } const group = new THREE.Group(); group.add(stemMesh); group.add(blossomMesh); world.add(group); map.triggerRepaint(); } );
normal abnormal
all
The text was updated successfully, but these errors were encountered:
Description
After adding the mesh of the gltf model to THREE.InstancedMesh, I modified the scaling, and the rendered effect seems to have lost some vertices
Reproduction steps
Code
Live example
Screenshots
normal
![2](https://cdn.statically.io/img/private-user-images.githubusercontent.com/2898403/283379840-21f86c13-f4b3-4946-a5b1-b0a65a7ea00e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0MTY0MTgsIm5iZiI6MTcyMTQxNjExOCwicGF0aCI6Ii8yODk4NDAzLzI4MzM3OTg0MC0yMWY4NmMxMy1mNGIzLTQ5NDYtYTViMS1iMGE2NWE3ZWEwMGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTlUMTkwODM4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmY3YjFmMmU0MzEwNWZmNTBhZjAwYjMyMWZmMmM2MTZiYzQxZjM2MTY5YjFiNTJjYWVlYmQ1OTQ1MDFhZGIzMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.ODeDu3cSkIn6ac7Vkz6keO03SgV2CTq0PF8Xt_4nxo4)
![1](https://cdn.statically.io/img/private-user-images.githubusercontent.com/2898403/283380055-40d96cff-b667-4639-a8cb-49e0ef6727fc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE0MTY0MTgsIm5iZiI6MTcyMTQxNjExOCwicGF0aCI6Ii8yODk4NDAzLzI4MzM4MDA1NS00MGQ5NmNmZi1iNjY3LTQ2MzktYThjYi00OWUwZWY2NzI3ZmMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTlUMTkwODM4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Mjc4NjEyNzhhZWRiYzVkNTNlZmViY2ZiYTdhMTczNTUzMzU2NGEwNTM4NWZjYzkzOTI5ZDZmYmY5MDZhMTIyYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.JkPy3OM-O4joK6dHeHf0hckW0wVmBdNQcMdkN8n8xwY)
abnormal
Version
all
The text was updated successfully, but these errors were encountered: