Rotate object 360 relative to camera

Bonatti-San
Sat, 03 Apr 2021 18:31:28 +0000
Cinematics & Media

Ok, I’m scratching my head about this.

I’m trying to rotate an object on X and Y axis relative to camera, but the Z relative to the world.

It’s a VR prototype, but the problem is not exclusive to VR. So I want the XY be the motion controller relative to the player rotation. For example: If the player tilt row (Y) while looking north, the object will rotate the Y axis. If looking east, will rotate X axis, and so on.

And the Z always fixed.

The problem is, when reach 90 degrees, the rotation goes crazy. Looks like it’s a problem with quaternion, which I didn’t understand nothing. lmao

I’m out of ideas. Anyone knows how to fix that?

What I’m trying to do:

The best solution I found but still the rotation go crazy:

1 post - 1 participant