Hey!
I have a camera as a child of a moving/rolling/pitching object, and I need to get the absolute pitchangle of the camera. Can that be done?
Cheers!
This works as I want, it is for a camera that shots the reflection image. The camera is child of a dummycube. The cube moves and turns, the camera uses pitch.
refCamCube.Position := camCube.position; refCamCube.turnangle := camCube.turnangle; refCam.pitchangle := cam.pitchangle * -1; refCamCube.Position.y := camCube.position.y * -1;
But in my intended program, the main camera is on a boat that rolls/pitches, so I need to use absolute values.
I tried like this, but it fails sometimes. CC is cameracube.
refCamCube.AbsolutePosition := cc.absolutePosition; refcamCube.Position.Y := cc.absolutePosition.Y * -1; refcamCube.direction.x:= cc.absolutedirection.x; refcamCube.direction.z:= cc.absolutedirection.z; refCam1.Direction.y := GLSceneViewer1.Camera.AbsoluteDirection.y; refCam1.direction.y := refCam1.direction.y * -1
Any idea what is wrong? Should this work?
Hi Daniel take the object you pitch/roll of your boat and set the inverse to you refCamCube like you did
Yes, I think it should work, but something is not correct with the way I take the absolutedirections. At some angles it fails. I will test a bit more.
Log in to post a comment.
Hey!
I have a camera as a child of a moving/rolling/pitching object, and I need to get the absolute pitchangle of the camera.
Can that be done?
Cheers!
This works as I want, it is for a camera that shots the reflection image. The camera is child of a dummycube. The cube moves and turns, the camera uses pitch.
But in my intended program, the main camera is on a boat that rolls/pitches, so I need to use absolute values.
I tried like this, but it fails sometimes. CC is cameracube.
Any idea what is wrong? Should this work?
Hi Daniel take the object you pitch/roll of your boat and set the inverse to you refCamCube like you did
Yes, I think it should work, but something is not correct with the way I take the absolutedirections.
At some angles it fails.
I will test a bit more.
Cheers!