#Rotate/Pivot Around Point

2 messages · Page 1 of 1 (latest)

pure trellis
#

Im so lost on this one - I have a 3d game where you are a spaceship.

The movement works by actually moving the world instead of the player (it's using openXR and doing it this way solves a TON of headaches)

Everything is going great except for rotations - im struggling so much with the transforms, despite knowing exactly what i need to do.

I need the world to pivot around the spaceship/player origin and it needs to work on all 3 axis

let's say the world moves down (equivalent to the player moving up) on the Y axis by 10 units - I think i need to draw a circle/ring around the player equidistantly at a distance of 10 units - then when the player/ship tries to rotate the world is actually moved along that ring.

That's how i visualize the problem/requirements in my head anyway,...the big issue is i have absolutely no idea how to get this out of the transform and the docs are not helping at all with regards to offset 3d rotations

Any help would be greatly appreciated, ive been stuck on this for quite some time and im starting to fear that is going to be the death of my project 😢

Thanks ❤️

Corin

pure trellis
#

I've made some progress - kinda - put a bit of a hack together, where i child a raycast to the world pointing at a hidden flat surface in the world. I then translate the world to the ship position, apply the rotations and then multiply the raycast normal by the distance from the ship.