Jump to content
The simFlight Network Forums
Delphi

CameraSetRelative6DOF with VB.net

Recommended Posts

Hi Paul,

is there any example available how to use CameraSetRelative6DOF with vb.net? I was not very successful with the definition of the structure for the FSUIPC offset.

Many thanks...

Ruediger

Share this post


Link to post
Share on other sites

Hi Ruediger.

Sample code below showing the declarations. Tested on FSX Steam Edition.

 ' CameraSetRelative6DOF offsets. 0x86A0 MUST be declared last
    Dim Camera_H As Offset(Of Single) = New Offset(Of Single)("SetCamera", &H86B4, True) ' Heading
    Dim Camera_B As Offset(Of Single) = New Offset(Of Single)("SetCamera", &H86B0, True) ' Bank
    Dim Camera_P As Offset(Of Single) = New Offset(Of Single)("SetCamera", &H86AC, True) ' Pitch
    Dim Camera_Z As Offset(Of Single) = New Offset(Of Single)("SetCamera", &H86A8, True) ' Z
    Dim Camera_Y As Offset(Of Single) = New Offset(Of Single)("SetCamera", &H86A4, True) ' Y
    Dim Camera_X As Offset(Of Single) = New Offset(Of Single)("SetCamera", &H86A0, True) ' X

    Private Sub btn6DOF_Click(sender As Object, e As EventArgs) Handles btn6DOF.Click
        ' Values can be set in any order
        ' Example: Centre Camera but look out of Left Window
        Camera_X.Value = 0
        Camera_Y.Value = 0
        Camera_Z.Value = 0
        Camera_P.Value = 0
        Camera_B.Value = 0
        Camera_H.Value = -90.0 ' Heading -90 degrees relative to the cockpit (Left Window)
        FSUIPCConnection.Process("SetCamera")
    End Sub

Paul

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.