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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

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.