dxRotateMesh(entity%,pitch#,yaw#,roll#)

Parameters

mesh - mesh handle
pitch# - pitch of mesh
yaw# - yaw of mesh
roll# - roll of mesh

Description

Rotates all vertices of a mesh by the specified rotation.

See also: dxRotateEntity, dxTurnEntity.

Example

; dxRotateMesh Example
; ------------------

; In this example we will demonstrate the use of the dxRotateMesh command.

; Unlike dxRotateEntity, dxRotateMesh actually modifies the actual mesh structure.

; So whereas using dxRotateEntity 0,45,0 would only rotate an entity by 45 degrees the first time it was
; used, dxRotateMesh 0,45,0 will rotate the mesh every time it is used.

; This is because dxRotateEntity rotates an entity based on a fixed mesh structure, whereas dxRotateMesh
; actually modifies the mesh structure itself.

dxGraphics3D 640,480
dxSetBuffer dxBackBuffer()

camera=dxCreateCamera()

light=dxCreateLight()

; Rotate light to give better lighting of cube
dxRotateEntity light,60,30,0

; Create cube mesh
cube=dxCreateCube()

; Position cube in front of camera so we can see it
dxPositionEntity cube,0,0,5

While Not dxKeyDown(1)

; If space bar pressed then rotate mesh by 45 degrees on the y axis. Also set syntax$ dxText.
If dxKeyHit(57)=True Then dxRotateMesh cube,0,45,0 : syntax$="dxRotateMesh 0,45,0"

dxRenderWorld

dxText 0,0,"Press space to rotate mesh by 45 degrees on the y axis"
dxText 0,20,syntax$

dxFlip

Wend

End

Index