How should mesh data be distributed across accessors, bufferViews, buffers in a glTF file?
In the glTF format,
mesh object positions go through three levels of indirection:
mesh -> accessor -> bufferView -> buffer.
How to rotate make a rotate a group backed on camaras orientation?
I am making a game where you have a sword that you can swing, the sword is in a group with an offset so it is positioned right. I am trying to make it so that when I press Z the sword swings down and then back up via rotation. how do I get the sword to swing in the direction I face? Currently, I have if (keys.z) group.rotation.x -= Math.PI/100;
, but that only works for the x-axis. The model copes the camera position with group.position.copy(camera.position);
, and quaternion with if(!keys.z)group.quaternion.copy(camera.quaternion);
.
One way I thought do do it was to change the sword’s rotation offset but I don’t know how to do that, would that even work? Anyways please help I love coding and want to make this game!
how to put a Gltf Model in a group
I’m trying to put a loaded gltf model in a group with a cube.