camera rotation

Started by Dune, December 24, 2018, 01:33:00 AM

Previous topic - Next topic

Dune

There's something I can't figure out, and it frustrates  >:( I have a boat and I need to match a camera with the angle the boat has. But the camera is pointing north by default and needs to be rotated first to point up. Then I need to add or subtract values from the boat's angle to tilt the cam. But as soon as it's pointing up (cam: X=90ยบ), the Z doesn't respond in the way I want; it only rotates over Y.
Anyone clever enough? Or is it just impossible?

It may be a very silly thing, but I got up this morning thinking it was 07.00 hours, while I saw downstairs that it was 05.00 hours  ::)

DocCharly65

#1
Hi Ulco, I know problems like this from my sometimes very complicated camera paths in my spaceship-flyby scenes.

I have played with your file and hope my result will help you a bit.
It' still not perfect but if you invest a little more time it could be a solution.
The z-axis seems to be the final camera01 view direction so I first concentrated on the "blue line" in 3D preview rotating mode.
I took the cubes b-box as orientation and tried to get the "blue line" rectangular to the cubes sides by rotating the camera01 with the  z- and y-axis.
Rotating the camera01 into the wished tilt angle via z-axis was my last step.

Is the result closer to your plan? My method only works via visual adjustment but perhaps it can help you a bit

[attachmini=1]

[attach=2]
[attach=3]
[attach=4]

cyphyr

This sounds like the old "Gimble lock" problem.
You could try recreating the scene in Lightwave (or your choice of 3d app) and import the camera from there as an .fbx or .chan.
That may help because you could set your rotation space to localas opposed to world.
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Dune

Thanks guys. So it seems there's no simple translation (or some math...) from object to cam, mmmm. I'll do it visually, that's probably the fastest. It's only 3 boats, so...

Dune

I used a simpler method to get the slightly angled waterline on my 3 boats, but there's something else spooking me. Not a big problem, but I just don't understand. Perhaps another simple explanation  :P

My boats are all on the same altitude, very near 0/0/0, but on one boat I needed to raise the altitude (from distribution shader altitude in terrain), so there's a difference of about 80cm, while the waterlines should all be appr. on same altitude.

bobbystahr

Very odd, following to find out why in case I run into this. Do the boats both have a zeroed axis?
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Dune

They're 3 of the same boat. But I think I may know, but have to check.... depends on where the disstribution shader takes it's altitude from....

bobbystahr

Quote from: Dune on December 29, 2018, 11:08:47 AM
They're 3 of the same boat. But I think I may know, but have to check.... depends on where the disstribution shader takes it's altitude from....

cool, seems like you're on the trail to resolution.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist