Irrlicht kamera mit Charakter richtig ausrichten

  • Hey Leute,
    Ich hab vor eiin paar Tagen begonnen mich mit der AU3Irrlicht2 udf zu beschäftigen und jetzt will ich mich mal versuchen ein Spiel zu ersellen.
    Das klappt eigentlich auch aber hier kommtm mein Problem:
    Also Ich habe eine map und ein charakter,
    jetzt will ich das die kamera immer auf den char zeigt, also Rollenspielansicht.
    Das der CHarakter immer dort ist wo auch die kammera ist hab ich bereits, aber leider steht er immer in einem abstand zur kamera und dreht sich nicht mit.
    Ich benutze noch die FPSCamera da ich mit der normalen (_IrrAdCamera) noch nicht so ganz zurrecht komme.
    Aber wenn jemand es gleich mit einer _IrrAdCamera() machen könnte währe ich noch glücklicher ^^
    So genug geredet, hier ist mein script :

    €hab das mit der sicht hinbekommen und das auf mausbewegungen gedreht wird hier ist mein neues script:

    Spoiler anzeigen
    [autoit]

    #include <au3Irrlicht2.au3>
    #include <misc.au3>
    #include <math.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Opt("MustDeclareVars", True)
    HotKeySet("{ESC}", "_exit")

    [/autoit] [autoit][/autoit] [autoit]

    Func _exit()
    _IrrStop()
    Exit
    EndFunc ;==>_exit

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Dim $Camera
    Dim $NodeGround
    Dim $NodeBox
    Dim $aPosition[3] = [0, 100, 0]
    Dim $iDegree = 0
    Dim $iDistance = 300
    Dim $m_pos
    Dim $m_desk_w
    Dim $m_desk_h
    Dim $font
    Global $size[2]
    Global $a, $b

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _b()
    $b = MouseGetPos()
    Sleep(1)
    EndFunc ;==>_b

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $m_desk_h = @DesktopHeight
    $m_desk_w = @DesktopWidth

    [/autoit] [autoit][/autoit] [autoit]

    $size[0] = $m_desk_w
    $size[1] = $m_desk_h

    [/autoit] [autoit][/autoit] [autoit]

    _IrrStart($IRR_EDT_OPENGL, $size[0], $size[1], 32, $IRR_WINDOWED, _
    $IRR_SHADOWS, $IRR_IGNORE_EVENTS, $IRR_VERTICAL_SYNC_ON)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _IrrSetWindowCaption("Example 49: Collision in a Loaded Scene")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _IrrChangeWorkingDirectory("media")
    _IrrLoadScene("CollisionScene.irr")

    [/autoit] [autoit][/autoit] [autoit]

    $font = _IrrGetFont("media/bitmapfont.bmp")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $Camera = _IrrAddCamera($aPosition[0] - 300, $aPosition[1] + 100, $aPosition[2], 0, 0, 0)

    [/autoit] [autoit][/autoit] [autoit]

    $NodeGround = _IrrGetSceneNodeFromName("Ground")
    $NodeBox = _IrrGetSceneNodeFromName("Pillar")
    _IrrSetNodePosition($NodeBox, $aPosition[0], $aPosition[1], $aPosition[2])

    [/autoit] [autoit][/autoit] [autoit]

    _IrrHideMouse()
    MouseMove(0, 0)

    [/autoit] [autoit][/autoit] [autoit]

    While _IrrRunning()
    $a = MouseGetPos()
    _IrrBeginScene(200, 200, 255)

    [/autoit] [autoit][/autoit] [autoit]

    ;_Irr2DFontDraw($font, $m_pos[0] & $m_pos[1], 4, 4, 250, 24)

    [/autoit] [autoit][/autoit] [autoit]

    _b()
    If $a[0] <> $b[0] Then
    If $a[0] > $b[0] Then
    $iDegree -= 1
    _IrrSetNodeRotation($NodeBox, 0, $iDegree, 0)
    ElseIf $a[0] < $b[0] Then
    $iDegree += 1
    _IrrSetNodeRotation($NodeBox, 0, $iDegree, 0)
    EndIf
    EndIf
    _IrrSetNodeRotation($NodeBox, 0, $iDegree, 0)

    [/autoit] [autoit][/autoit] [autoit]

    If _IsPressed(26) Then
    $aPosition[0] += Cos(_Radian($iDegree)) * 2
    $aPosition[2] -= Sin(_Radian($iDegree)) * 2
    _IrrSetNodePosition($NodeBox, $aPosition[0], $aPosition[1], $aPosition[2])
    EndIf
    _CalcCamera()

    [/autoit] [autoit][/autoit] [autoit]

    _IrrDrawScene()

    [/autoit] [autoit][/autoit] [autoit]

    _IrrEndScene()
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    _IrrStop()

    [/autoit] [autoit][/autoit] [autoit]

    Func _CalcCamera()
    Local $aPos[3]
    $aPos[0] = $aPosition[0] - Cos(_Radian($iDegree)) * $iDistance
    $aPos[2] = $aPosition[2] + Sin(_Radian($iDegree)) * $iDistance
    $aPos[1] = $aPosition[1] + 100
    _IrrSetNodePosition($Camera, $aPos[0], $aPos[1], $aPos[2])
    _IrrSetCameraTarget($Camera, $aPosition[0], $aPosition[1], $aPosition[2])
    EndFunc ;==>_CalcCamera

    [/autoit]


    Jetzt funktioniert es teilweise aber es ruckelt stark beim drehen, wer ne bessere Methode hat die sicht zu drehen bitte hier posten^^ am besten direkt am beispiel

    Das Alte Script:

    Spoiler anzeigen
    [autoit]


    ; ----------------------------------------------------------------------------
    ; Example 13: Camera Position
    ; This example creates a map for you to move around and displays the current
    ; position of the camera and its rotation on the screen
    ; ----------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ; ////////////////////////////////////////////////////////////////////////////
    ; Includes for extension libraries
    #include "au3Irrlicht2.au3"
    Opt("MustDeclareVars", True)
    HotKeySet("{ESC}", "_exit")

    [/autoit] [autoit][/autoit] [autoit]

    Func _exit()
    _IrrStop()
    Exit
    EndFunc ;==>_exit

    [/autoit] [autoit][/autoit] [autoit]

    ; ////////////////////////////////////////////////////////////////////////////
    ; global variables

    [/autoit] [autoit][/autoit] [autoit]

    ; irrlicht objects
    Dim $BSPMesh ; irr_mesh
    Dim $BSPNode ; irr_node
    Dim $Camera ; irr_camera
    Dim $BitmapFont ; irr_font
    Dim $X ; Single
    Dim $Y ; Single
    Dim $Z ; Single
    Dim $metrics ; String
    Dim $a_vector3df[3]
    Dim $MapCollision ;
    Global $grav[3], $rad[3], $pos[3], $tar[3], $char[3], $pos1[3]
    Global $mesh1, $texture, $node1, $frame, $posit

    [/autoit] [autoit][/autoit] [autoit]

    ; ////////////////////////////////////////////////////////////////////////////

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; -----------------------------------------------------------------------------
    ; start the irrlicht interface
    _IrrStart($IRR_EDT_DIRECT3D9, 800, 600, $IRR_BITS_PER_PIXEL_32, _
    $IRR_WINDOWED, $IRR_NO_SHADOWS, $IRR_IGNORE_EVENTS, $IRR_VERTICAL_SYNC_ON)
    ; set the window caption
    _IrrSetWindowCaption("Example 13: Camera Position and Rotation")

    [/autoit] [autoit][/autoit] [autoit]

    ; create a frist person perspective camera that can be controlled with mouse
    ; and cursor keys

    [/autoit] [autoit][/autoit] [autoit]

    $pos[0] = 1750 ;x
    $pos[1] = 144 ;y
    $pos[2] = 1369 ;z

    [/autoit] [autoit][/autoit] [autoit]

    $tar[0] = 1175;x
    $tar[1] = 130;y
    $tar[2] = 1364;z

    [/autoit] [autoit][/autoit] [autoit]

    $Camera = _IrrAddFpsCamera()
    ;$Camera = _IrrAddCamera($pos[0], $pos[1], $pos[2], $tar[0], $tar[1], $tar[2])
    ;_IrrSetNodePosition($node1, $tar[0], $tar[1], $tar[2])
    ;$Camera = _IrrAddFpsCamera()

    [/autoit] [autoit][/autoit] [autoit]

    ; reposition and rotate the camera to look at a nice part of the map
    _IrrSetNodePosition($Camera, 1750, 149, 1369)
    _IrrSetNodeRotation($Camera, 4, -461.63, 0)

    [/autoit] [autoit][/autoit] [autoit]

    ; load a Quake 3 BSP Map from a zip archive
    _IrrAddZipFile("media/map-20kdm2.pk3", $IRR_IGNORE_CASE, $IRR_IGNORE_PATHS)
    $BSPMesh = _IrrGetMesh("20kdm2.bsp")
    $BSPNode = _IrrAddMeshToSceneAsOcttree($BSPMesh)

    [/autoit] [autoit][/autoit] [autoit]

    $rad[0] = 20;x rechts
    $rad[1] = 30;y oben
    $rad[2] = 20;z hinten

    [/autoit] [autoit][/autoit] [autoit]

    ;Gravitation => wie stark nach x, y, z ,zieht
    $grav[0] = 0;x
    $grav[1] = -9.8;y
    $grav[2] = 0;z

    [/autoit] [autoit][/autoit] [autoit]

    $MapCollision = _IrrGetCollisionGroupFromComplexMesh($BSPMesh, $BSPNode)
    _IrrAddCollisionAnimator($MapCollision, $Camera, $rad[0], $rad[1], $rad[2], $grav[0], $grav[1], $grav[2], 0.0, 50.0, 0.0)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $char[0] = 1
    $char[1] = 2
    $char[2] = 3

    [/autoit] [autoit][/autoit] [autoit]

    $mesh1 = _IrrGetMesh("media/zumlin.md2")
    $texture = _IrrGetTexture("media/zumlin.pcx")

    [/autoit] [autoit][/autoit] [autoit]

    $node1 = _IrrAddMeshToScene($mesh1)
    _IrrSetNodeMaterialTexture($node1, $texture, 0)
    _IrrSetNodeMaterialFlag($node1, $IRR_EMF_LIGHTING, $IRR_OFF)
    _IrrPlayNodeMD2Animation($node1, $IRR_EMAT_RUN)
    _IrrSetNodeAnimationSpeed($node1, 30)

    [/autoit] [autoit][/autoit] [autoit]

    $BitmapFont = _IrrGetFont("media/bitmapfont.bmp")

    [/autoit] [autoit][/autoit] [autoit]

    ; we also hide the mouse pointer to see the view better
    _IrrHideMouse()

    [/autoit] [autoit][/autoit] [autoit]

    ; -----------------------------------------------------------------------------
    ; while the irrlicht environment is still running
    While _IrrRunning()
    ; begin the scene, erasing the canvas with sky-blue before rendering
    _IrrBeginScene(50, 50, 50)

    [/autoit] [autoit][/autoit] [autoit]

    ; draw the scene
    _IrrDrawScene()

    [/autoit] [autoit][/autoit] [autoit]

    $posit = _IrrGetNodePosition($Camera)
    $pos1[0] = $posit[0] - 100
    $pos1[1] = $posit[1] - 45
    $pos1[2] = $posit[2]
    _IrrSetNodePosition($node1, $pos1[0], $pos1[1], $pos1[2])

    [/autoit] [autoit][/autoit] [autoit]

    ; get the position of the camera into the supplied array
    $a_vector3df = _IrrGetNodePosition($Camera)

    [/autoit] [autoit][/autoit] [autoit]

    ; create a wide string with a list of the positions in
    $metrics = "POSITION " & Int($a_vector3df[0]) & " " & Int($a_vector3df[1]) & " " & Int($a_vector3df[2]) & " "

    [/autoit] [autoit][/autoit] [autoit]

    ; draw this position information to the screen
    _Irr2DFontDraw($BitmapFont, $metrics, 4, 4, 250, 24)

    [/autoit] [autoit][/autoit] [autoit]

    ; get the rotation of the camera into the supplied array
    $a_vector3df = _IrrGetNodeRotation($Camera)

    [/autoit] [autoit][/autoit] [autoit]

    ; create a wide string with a list of the rotations in
    $metrics = "ROTATION " & Int($a_vector3df[0]) & " " & Int($a_vector3df[1]) & " " & Int($a_vector3df[2]) & " "

    [/autoit] [autoit][/autoit] [autoit]

    ; draw this position information to the screen
    _Irr2DFontDraw($BitmapFont, $metrics, 4, 32, 250, 52)

    [/autoit] [autoit][/autoit] [autoit]

    ; end drawing the scene and display it
    _IrrEndScene()
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    ; -----------------------------------------------------------------------------
    ; Stop the irrlicht engine and release resources
    _IrrStop()

    [/autoit]

    Ich hab noch ein Problem entdeckt:
    Also ich wollte den Collision punkt dem zumlin modell zuweisen wenn ich jetzt aber bei _IrrAddCollisionAnimator anstatt

    Spoiler anzeigen

    ($MapCollision, $Camera, $rad[0], $rad[1], $rad[2], $grav[0], $grav[1], $grav[2], 0.0, 50.0, 0.0)

    das einfüge:

    Spoiler anzeigen

    ($MapCollision, $mesh1, $rad[0], $rad[1], $rad[2], $grav[0], $grav[1], $grav[2], 0.0, 50.0, 0.0)

    kommt dieser Fehler: http://www.bilder-upload.eu/show.php?file=…-1325619401.png

    §1 Ich kann nicht für meine scripts inhaftiert werden, auch wenn bereits 3 Menschen erblindeten an den Folgen der Korrekturlesung.  8o

    5 Mal editiert, zuletzt von YellowWeedSeed (10. Januar 2012 um 20:02)

  • was willst du jetzt genau haben?
    Kamera folgt dem Charakter?
    Charakter folgt der Kamera?
    ego shooter?

    Das konnte ich noch nicht richtig rauslesen ^^

    MFG Schnacko

  • also ich will eine 3.te person ansicht auf den charakter.
    Also man sieht ihn (wenn man geradeaus läuft) immer von hinten und er soll immer in die richtung laufen in die die kamera zeigt.
    Ich hoffe du verstehst was ich mein.
    Kleines bsp
    [Blockierte Grafik: http://s1.directupload.net/images/120103/temp/kmb3d5nn.png]
    dürfte eigentlich zeigen wie ich das meine (der rote punkt ist der standpunkt der kamera) Die kamera soll immer im gleichen Abstand zum charakter sein

    §1 Ich kann nicht für meine scripts inhaftiert werden, auch wenn bereits 3 Menschen erblindeten an den Folgen der Korrekturlesung.  8o

    Einmal editiert, zuletzt von YellowWeedSeed (3. Januar 2012 um 20:20)

  • kannst du das etwas genauer erklären (ich raff grad net so ganz was du meinst ^^ )

    §1 Ich kann nicht für meine scripts inhaftiert werden, auch wenn bereits 3 Menschen erblindeten an den Folgen der Korrekturlesung.  8o

  • Hab dir da mal was gecodet, wenn ich dich richtig verstanden habe:

    Spoiler anzeigen
    [autoit]

    #AutoIt3Wrapper_usex64=n

    [/autoit] [autoit][/autoit] [autoit]

    #include <au3Irrlicht2.au3>
    #include <misc.au3>
    #include <math.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Opt("MustDeclareVars", True)
    HotKeySet("{ESC}", "_exit")

    [/autoit] [autoit][/autoit] [autoit]

    Func _exit()
    _IrrStop()
    Exit
    EndFunc ;==>_exit

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Dim $Camera
    Dim $NodeGround
    Dim $NodeBox
    Dim $aPosition[3] = [0, 100, 0]
    Dim $iDegree = 0
    Dim $iDistance = 300

    [/autoit] [autoit][/autoit] [autoit]

    _IrrStart($IRR_EDT_OPENGL, 800, 600, 32, $IRR_WINDOWED, _
    $IRR_SHADOWS, $IRR_IGNORE_EVENTS, $IRR_VERTICAL_SYNC_ON)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _IrrSetWindowCaption("Example 49: Collision in a Loaded Scene")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _IrrChangeWorkingDirectory("../media")
    _IrrLoadScene("CollisionScene.irr")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $Camera = _IrrAddCamera($aPosition[0] - 300, $aPosition[1] + 100, $aPosition[2], 0, 0, 0)

    [/autoit] [autoit][/autoit] [autoit]

    $NodeGround = _IrrGetSceneNodeFromName("Ground")
    $NodeBox = _IrrGetSceneNodeFromName("Pillar")
    _IrrSetNodePosition($NodeBox, $aPosition[0], $aPosition[1], $aPosition[2])

    [/autoit] [autoit][/autoit] [autoit]

    _IrrHideMouse()

    [/autoit] [autoit][/autoit] [autoit]

    While _IrrRunning()

    [/autoit] [autoit][/autoit] [autoit]

    _IrrBeginScene(200, 200, 255)
    If _IsPressed(25) Then
    $iDegree -= 1
    _IrrSetNodeRotation($NodeBox, 0, $iDegree, 0)
    EndIf
    If _IsPressed(27) Then
    $iDegree += 1
    _IrrSetNodeRotation($NodeBox, 0, $iDegree, 0)
    EndIf
    If _IsPressed(26) Then
    $aPosition[0] += Cos(_Radian($iDegree)) * 2
    $aPosition[2] -= Sin(_Radian($iDegree)) * 2
    _IrrSetNodePosition($NodeBox, $aPosition[0], $aPosition[1], $aPosition[2])
    EndIf
    _CalcCamera()

    [/autoit] [autoit][/autoit] [autoit]

    _IrrDrawScene()

    [/autoit] [autoit][/autoit] [autoit]

    _IrrEndScene()
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    _IrrStop()

    [/autoit] [autoit][/autoit] [autoit]

    Func _CalcCamera()
    Local $aPos[3]
    $aPos[0] = $aPosition[0] - Cos(_Radian($iDegree)) * $iDistance
    $aPos[2] = $aPosition[2] + Sin(_Radian($iDegree)) * $iDistance
    $aPos[1] = $aPosition[1] + 100
    _IrrSetNodePosition($Camera, $aPos[0], $aPos[1], $aPos[2])
    _IrrSetCameraTarget($Camera, $aPosition[0], $aPosition[1], $aPosition[2])
    EndFunc ;==>_CalcCamera

    [/autoit]

    Das muss in den Beispiel-Order, oder du passt die Pfade an..

    Fresapore

  • jetzt hast du's fast (die sicht ist perfekt! :D ) nur hab ich jetzt 2 porbs:
    1. Ich wollte das man mit der maus die richtung steuert, also durch bewegen der maus (wie fpscam) und dann nur noch eine taste drücken muss um sich nach vorn zu bewegen.
    2. hab ich keine Ahnung was das script da macht, wenn jemand evtl noch es etwas komentieren könnte (also nur die sache mit sin und cos das vertseh ich garnicht, der rest ist soweit klar) :D schliesslich will ich ja auch was draus lernen und nicht nächstes mal wieder fragen müssen.

    Ansonsten Vielen dank für deine mühe hat mir auch so schon ein stück weiter geholfen :thumbup:

    mfg YellowWeedSeed

    §1 Ich kann nicht für meine scripts inhaftiert werden, auch wenn bereits 3 Menschen erblindeten an den Folgen der Korrekturlesung.  8o

    Einmal editiert, zuletzt von YellowWeedSeed (3. Januar 2012 um 21:24)

  • Oha, das mit der Maus wusst ich nicht..das kriegst du so einfach (performant, ohne FPS) nicht hin. Kannst mal das Irrcube (Signatur) angucken, da ist das auch gemacht.
    Naja, mit der linken und rechten Pfeiltaste verändert man die Gradzahl. Durch die Pfeil-nach-oben-taste berechnet man den Anteil in x und in y richtung der Bewegung mithilfe des Sin/cos.
    Y: Sin = Gegenkathete/Hypotenuse --> Gegenkathete = Sin(Winkel)
    X: Cos = Ankathete/Hypothenuse...

    Die Kamera befindet sich auf einem Kreis um das Node. Die Kreiskoordinaten berechnet man ähnlich.
    X = Cos(Winkel) * Radius
    Y = Sin(Winkel) * Radius


    Fresapore

  • So habs hingekriegt ist aber sehr buggy, script hab ich oben reineditiert. :thumbup:

    §1 Ich kann nicht für meine scripts inhaftiert werden, auch wenn bereits 3 Menschen erblindeten an den Folgen der Korrekturlesung.  8o

    Einmal editiert, zuletzt von YellowWeedSeed (3. Januar 2012 um 23:33)

  • sieh dir Flutch in meiner Signatur an,
    da hab ich die selbe Kameraeinstellung gemacht!

    MFG Schnacko

  • Ja das script kenn ich bereits, wollte nur schauen ob ich das auch selber hinkrieg :thumbup: , Weil Copy&Paste kann jeder

    mfg YellowWeedSeed

    §1 Ich kann nicht für meine scripts inhaftiert werden, auch wenn bereits 3 Menschen erblindeten an den Folgen der Korrekturlesung.  8o

  • Mal ne einfache Maussteuerung:

    Spoiler anzeigen
    [autoit]

    #AutoIt3Wrapper_usex64=n

    [/autoit] [autoit][/autoit] [autoit]

    #include <au3Irrlicht2.au3>
    #include <misc.au3>
    #include <math.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Opt("MustDeclareVars", True)
    HotKeySet("{ESC}", "_exit")

    [/autoit] [autoit][/autoit] [autoit]

    Func _exit()
    _IrrStop()
    Exit
    EndFunc ;==>_exit

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Dim $Camera
    Dim $NodeGround
    Dim $NodeBox
    Dim $aPosition[3] = [0, 100, 0]
    Dim $iDegree = 0
    Dim $iDistance = 300
    Dim $iWidth = @DesktopWidth
    Dim $iHeight = @DesktopHeight
    Dim $MouseXPos

    [/autoit] [autoit][/autoit] [autoit]

    _IrrStart($IRR_EDT_OPENGL, 800, 600, 32, $IRR_WINDOWED, _
    $IRR_SHADOWS, $IRR_IGNORE_EVENTS, $IRR_VERTICAL_SYNC_ON)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _IrrSetWindowCaption("Example 49: Collision in a Loaded Scene")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _IrrChangeWorkingDirectory("../media")
    _IrrLoadScene("CollisionScene.irr")

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $Camera = _IrrAddCamera($aPosition[0] - 300, $aPosition[1] + 100, $aPosition[2], 0, 0, 0)

    [/autoit] [autoit][/autoit] [autoit]

    $NodeGround = _IrrGetSceneNodeFromName("Ground")
    $NodeBox = _IrrGetSceneNodeFromName("Pillar")
    _IrrSetNodePosition($NodeBox, $aPosition[0], $aPosition[1], $aPosition[2])

    [/autoit] [autoit][/autoit] [autoit]

    _IrrHideMouse()
    While _IrrRunning()
    $MouseXPos = MouseGetPos(0)
    MouseMove($iWidth/2, $iHeight/2, 0)
    $iDegree -= ($iWidth/2-$MouseXPos)/5
    _IrrBeginScene(200, 200, 255)
    ;~ If _IsPressed(25) Then
    ;~ $iDegree -= 1
    ;~ _IrrSetNodeRotation($NodeBox, 0, $iDegree, 0)
    ;~ EndIf
    ;~ If _IsPressed(27) Then
    ;~ $iDegree += 1
    ;~ _IrrSetNodeRotation($NodeBox, 0, $iDegree, 0)
    ;~ EndIf
    _IrrSetNodeRotation($NodeBox, 0, $iDegree, 0)
    If _IsPressed(26) Then
    $aPosition[0] += Cos(_Radian($iDegree)) * 2
    $aPosition[2] -= Sin(_Radian($iDegree)) * 2
    _IrrSetNodePosition($NodeBox, $aPosition[0], $aPosition[1], $aPosition[2])
    EndIf
    _CalcCamera()
    _IrrDrawScene()

    [/autoit] [autoit][/autoit] [autoit]

    _IrrEndScene()

    [/autoit] [autoit][/autoit] [autoit]

    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    _IrrStop()

    [/autoit] [autoit][/autoit] [autoit]

    Func _CalcCamera()
    Local $aPos[3]
    $aPos[0] = $aPosition[0] - Cos(_Radian($iDegree)) * $iDistance
    $aPos[2] = $aPosition[2] + Sin(_Radian($iDegree)) * $iDistance
    $aPos[1] = $aPosition[1] + 100
    _IrrSetNodePosition($Camera, $aPos[0], $aPos[1], $aPos[2])
    _IrrSetCameraTarget($Camera, $aPosition[0], $aPosition[1], $aPosition[2])
    Sleep(10)
    EndFunc ;==>_CalcCamera

    [/autoit]

    Das ähnelt jetzt aber einer FPS..usst du wissen, was du dann nimmst. Hier ist pro schleifendurchlauf nur eine Mauspositionsabfrage...

    P.S.: Sleep(1) gibt es nicht, daraus wird sleep(10)

    Fresapore

  • Vielen dank das ist genau das was ich wollte und das wegen sleep wusste ich noch gar nicht 8o aber macht ja nichts, jetzt weiß ich's

    mfg YellowweedSeed

    §1 Ich kann nicht für meine scripts inhaftiert werden, auch wenn bereits 3 Menschen erblindeten an den Folgen der Korrekturlesung.  8o