| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>EntityRoll# ( entity[,global] )</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- entity - name of entity that will have roll angle returned
<br />
- global (optional) - true if the roll angle returned should be relative to 0 rather than a parent entity's roll angle. False by default.
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Returns the roll angle of an entity.
<br />
-
<br />
- The roll angle is also the z angle of an entity.
- </td>
- </tr>
- </table>
- <h1><a href=../3d_examples/EntityRoll.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; EntityRoll Example
<br />
- ; -------------------
<br />
-
<br />
- Graphics3D 640,480
<br />
- SetBuffer BackBuffer()
<br />
-
<br />
- camera=CreateCamera()
<br />
- light=CreateLight()
<br />
-
<br />
- cone=CreateCone( 32 )
<br />
- PositionEntity cone,0,0,5
<br />
-
<br />
- While Not KeyDown( 1 )
<br />
-
<br />
- pitch#=0
<br />
- yaw#=0
<br />
- roll#=0
<br />
-
<br />
- If KeyDown( 208 )=True Then pitch#=-1
<br />
- If KeyDown( 200 )=True Then pitch#=1
<br />
- If KeyDown( 203 )=True Then yaw#=-1
<br />
- If KeyDown( 205 )=True Then yaw#=1
<br />
- If KeyDown( 45 )=True Then roll#=-1
<br />
- If KeyDown( 44 )=True Then roll#=1
<br />
-
<br />
- TurnEntity cone,pitch#,yaw#,roll#
<br />
-
<br />
- RenderWorld
<br />
-
<br />
- Text 0,0,"Use cursor/Z/X keys to turn cone"
<br />
-
<br />
- ; Return entity roll angle of cone
<br />
- Text 0,20,"Roll: "+EntityRoll#( cone )
<br />
-
<br />
- Flip
<br />
-
<br />
- Wend
<br />
-
<br />
- End
- </td>
- </tr>
- </table>
- <br>
- <a target=_top href=../index.htm>Index</a><br>
- <br>
- Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=EntityRoll&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|