Lining up things

Started by JBR, February 12, 2020, 01:07:37

Previous topic - Next topic

JBR

Hi,

I have a rotating space station rotating around x axis (Pitch).

My camera should match the space station around z axis (Roll). So its entrance is lined up.

Problem is the Roll goes 0-> 180, -180 -> 0 but the Pitch goes 0->90->0->-90->0

So half the time they match, but why does the pitch not go to 180?

I'd post a bit of code but it is an experimental mess.

Thanks, Jim

Matty

Greetings JBR you are better off aligning things using thenvector commands like align to vector than rotating via pitch and roll.

You will need to match the forwards and up vectors of the camera in order to do this easily.

The tformnormal commands will allow you to get the curremt forwards and up vectors from local space to world space.

Then you simply use aligntovector to align along relevant axes.

That should do it.