I’m creating a website, which lets user upload it’s own GLTF models of animals. Model is then added to a a group named AnimalGroup.
AnimalGroup contains:
- GLTF model (which can be complex and made out of many children (body, 2 eyes, tongue, etc.)
- RayCastHitbox (BoxGeometry which is the same size as animal and set transparent)
- some other meshes
Scene can have any number of AnimalGroups.
I managed to do position change by setting AnimalGroup.position.set(x,y,z) and scale by setting AnimalGroup.scale.set(x,y,z) but I cannot figure out rotation.
When I apply rotation by setting AnimalGroup.rotateX(rad) (or Y or Z), animal group is rotating around scene centre, but not around its group centre.
Thanks for any provided help!