Hilfe
DeltaYaw
Aufruf
Parameter
Rückgabewert
Beschreibung
Zusatzinformation
Beispiel
Siehe auch
Winkel# = DeltaYaw# (Quelle, Ziel)
Parameter
Quelle | Identität eines Quell-Entitys |
Ziel | Identität eines Ziel-Entitys |
Rückgabewert
Es wird ein Winkel in Grad zurückgeliefert (Y-Achse)
Beschreibung
Die Funktion DeltaYaw berechnet den Winkel, der für eine Drehung eines Objekts zu einem anderen notwendig ist. Dabei wird die Position und die drei Drehwinkel beachtet.
DeltaYaw liefert einen Drehwinkel für die Y-Achse. Die zweite Funktion DeltaPitch berechnet einen Drehwinkel für die X-Achse. Eine dritte Funktion für die Z-Achse ist nicht notwendig!
Gebe einfach die Identität eines Quell-Objekts und die Identität eines Ziel-Objekts ein
Zusatzinformation
Dies ist ein undokumentierter Befehl. Sollte dieser Befehl wieder offiziell entfernt werden, wären Programme zu allen zukünftigen Updates nicht mehr kompatibel und müssten umgeschrieben werden. Die Anwendung ist daher auf eigenes Risiko.
Beispiel
Standardbeispiel:
Dieses Programm erstellt zwei Objekte: einen Zylinder und eine Kugel. Die Kugel kann verschoben werden. Der Zylinder zeigt aber immer auf die Kugel:
Graphics3D 640, 480, 16, 2
SetBuffer BackBuffer()
camera = CreateCamera()
light = CreateLight()
PositionEntity camera, 0, 0, -5
RotateEntity light, 90, 0, 0
cylinder = CreateCylinder(20)
sphere = CreateSphere()
RotateMesh cylinder, 90, 0, 0
ScaleEntity cylinder, 1, 1, 3
PositionEntity cylinder, 0, 0, 5
EntityAlpha sphere, .8
EntityColor sphere, 255, 100, 100
While Not KeyHit(1)
If KeyDown(200) Then MoveEntity sphere, 0, .1, 0
If KeyDown(208) Then MoveEntity sphere, 0,- .1, 0
If KeyDown(203) Then MoveEntity sphere, -.1, 0, 0
If KeyDown(205) Then MoveEntity sphere, .1, 0, 0
pitch# = EntityPitch#(cylinder) + DeltaPitch#(cylinder, sphere)
yaw# = EntityYaw#(cylinder) + DeltaYaw#(cylinder, sphere)
roll# = EntityRoll#(cylinder)
RotateEntity cylinder, pitch#, yaw#, roll#
RenderWorld
Flip
Wend
End
Graphics3D 640, 480, 16, 2
SetBuffer BackBuffer()
camera = CreateCamera()
light = CreateLight()
PositionEntity camera, 0, 0, -5
RotateEntity light, 90, 0, 0
cylinder = CreateCylinder(20)
sphere = CreateSphere()
RotateMesh cylinder, 90, 0, 0
ScaleEntity cylinder, 1, 1, 3
PositionEntity cylinder, 0, 0, 5
EntityAlpha sphere, .8
EntityColor sphere, 255, 100, 100
While Not KeyHit(1)
If KeyDown(200) Then MoveEntity sphere, 0, .1, 0
If KeyDown(208) Then MoveEntity sphere, 0,- .1, 0
If KeyDown(203) Then MoveEntity sphere, -.1, 0, 0
If KeyDown(205) Then MoveEntity sphere, .1, 0, 0
pitch# = EntityPitch#(cylinder) + DeltaPitch#(cylinder, sphere)
yaw# = EntityYaw#(cylinder) + DeltaYaw#(cylinder, sphere)
roll# = EntityRoll#(cylinder)
RotateEntity cylinder, pitch#, yaw#, roll#
RenderWorld
Flip
Wend
End
Siehe auch
DeltaPitch, VectorPitch, VectorYaw, EntityPitch, EntityRoll, EntityYaw

