Menu

Absolute pitchAngle

Help
Daniel
2020-05-24
2020-06-06
  • Daniel

    Daniel - 2020-05-24

    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!

     
  • Daniel

    Daniel - 2020-06-03

    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?

     
  • Jerome.D (BeanzMaster)

    Hi Daniel take the object you pitch/roll of your boat and set the inverse to you refCamCube like you did

     
  • Daniel

    Daniel - 2020-06-06

    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!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.