Author Topic: camera rotation  (Read 399 times)

Offline Dune

  • Member
  • *
  • Posts: 15048
    • www.ulco-art.nl
camera rotation
« on: December 24, 2018, 05:33:00 AM »
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  ::)
« Last Edit: December 24, 2018, 05:47:04 AM by Dune »

Offline DocCharly65

  • Member
  • *
  • Posts: 2992
  • May the farce be with you...
    • Doc Charly on YouTube
Re: camera rotation
« Reply #1 on: December 24, 2018, 09:15:48 AM »
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

* match cam with object testfile (3).tgd

87001-1
87003-2
87005-3
« Last Edit: December 24, 2018, 09:17:32 AM by DocCharly65 »

Offline cyphyr

  • Member
  • *
  • Posts: 4001
    • richardfraser
Re: camera rotation
« Reply #2 on: December 24, 2018, 09:57:43 AM »
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.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

i7 5930 @3.5Ghz, 32Gb (TG3 benchmark 6:04)
i7 980 OC'd @3.9Ghz, 16Gb (TG3 benchmark 6:30)

Offline Dune

  • Member
  • *
  • Posts: 15048
    • www.ulco-art.nl
Re: camera rotation
« Reply #3 on: December 24, 2018, 11:43:32 AM »
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...

Offline Dune

  • Member
  • *
  • Posts: 15048
    • www.ulco-art.nl
Re: camera rotation
« Reply #4 on: December 28, 2018, 06:10:57 AM »
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.

Offline bobbystahr

  • Member
  • *
  • Posts: 10249
  • Turn, and face the Strange Ch Ch Changes...D Bowie
Re: camera rotation
« Reply #5 on: December 29, 2018, 02:03:48 PM »
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

Offline Dune

  • Member
  • *
  • Posts: 15048
    • www.ulco-art.nl
Re: camera rotation
« Reply #6 on: December 29, 2018, 03:08:47 PM »
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....

Offline bobbystahr

  • Member
  • *
  • Posts: 10249
  • Turn, and face the Strange Ch Ch Changes...D Bowie
Re: camera rotation
« Reply #7 on: December 29, 2018, 09:26:41 PM »
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

 

anything