drehproblem
Übersicht

IonPainterBetreff: drehproblem |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
ho
issn dummer kleiner fehler... probiert den code mal aus und drückt pfeiltaste nach oben, wenn das cube sich 90 grad gedreht hat zuckelt es nur noch so komisch, es soll sich aber um 360 grad frei bewegen lassen... Code: [AUSKLAPPEN] .Konstanten Const BP_MY_ID = 1 Const Name$ = "IonPainter" Const AufloesungBreite = 800 Const AufloesungHoehe = 600 Const Farbtiefe = 32 Const Fenstermodus = 2 .Types Type SpielerDaten Field ID Field Name$ Field FlugzeugModell Field PositionX# Field PositionY# Field PositionZ# Field RotationX# Field RotationY# Field RotationZ# End Type .Globals Global Spieler.SpielerDaten Global Kamera Global Licht Global Flugzeugmodell Main() Function Main() Initialisierung() Init_Kamera() Resourcen_laden() Spieler_erstellen() Hauptschleife() Beenden() End Function Function Initialisierung() Graphics3D AufloesungBreite, AufloesungHoehe, Farbtiefe, Fenstermodus SetBuffer BackBuffer() SeedRnd MilliSecs() EnableDirectInput 1 HidePointer End Function Function Init_Kamera() Kamera = CreateCamera() CameraViewport Kamera, 0, 0, AufloesungBreite, AufloesungHoehe CameraRange Kamera, 0.1, 10000 Licht = CreateLight(1, Kamera) MoveEntity Kamera, 0, 2, -5 End Function Function Resourcen_laden() Flugzeugmodell = CreateCube() ScaleEntity Flugzeugmodell, 1, 0.25, 2 HideEntity Flugzeugmodell End Function Function Spieler_erstellen() Spieler.SpielerDaten = New SpielerDaten Spieler\ID = BP_MY_ID Spieler\Name$ = Name$ Spieler\Flugzeugmodell = CopyEntity(Flugzeugmodell) ; EntityParent Kamera, Spieler\Flugzeugmodell End Function Function Hauptschleife() While Not KeyHit(1) Eingabe() UpdateWorld() RenderWorld() Flip() Wend End Function Function Eingabe() For Spieler.SpielerDaten = Each SpielerDaten If Spieler\ID = BP_MY_ID Then If KeyDown(200) Then RotateEntity Spieler\Flugzeugmodell, EntityPitch(Spieler\Flugzeugmodell) + 2.5, EntityYaw(Spieler\Flugzeugmodell), EntityRoll(Spieler\Flugzeugmodell) EndIf If KeyDown(208) Then EndIf If KeyDown(203) Then EndIf If KeyDown(205) Then EndIf EndIf Next End Function Function Beenden() ClearWorld() End() End Function |
||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group