| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>PositionTexture texture,u_position#,v_position#</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- texture - texture handle
<br />
- u_position# - u position of texture
<br />
- v_position# - v position of texture
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Positions a texture at an absolute position.
<br />
-
<br />
- This will have an immediate effect on all instances of the texture being used.
<br />
-
<br />
- Positioning a texture is useful for performing scrolling texture effects, such as for water etc.
- </td>
- </tr>
- </table>
- <h1><a href=../3d_examples/PositionTexture.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; PositionTexture Example
<br />
- ; -----------------------
<br />
-
<br />
- Graphics3D 640,480
<br />
- SetBuffer BackBuffer()
<br />
-
<br />
- camera=CreateCamera()
<br />
-
<br />
- light=CreateLight()
<br />
- RotateEntity light,90,0,0
<br />
-
<br />
- cube=CreateCube()
<br />
- PositionEntity cube,0,0,5
<br />
-
<br />
- ; Load texture
<br />
- tex=LoadTexture( "media/b3dlogo.jpg" )
<br />
-
<br />
- ; Texture cube
<br />
- EntityTexture cube,tex
<br />
-
<br />
- ; Set initial uv position values
<br />
- u_position#=1
<br />
- v_position#=1
<br />
-
<br />
- While Not KeyDown( 1 )
<br />
-
<br />
- ; Change uv position values depending on key pressed
<br />
- If KeyDown( 208 )=True Then u_position#=u_position#-0.01
<br />
- If KeyDown( 200 )=True Then u_position#=u_position#+0.01
<br />
- If KeyDown( 203 )=True Then v_position#=v_position#-0.01
<br />
- If KeyDown( 205 )=True Then v_position#=v_position#+0.01
<br />
-
<br />
- ; Position texture
<br />
- PositionTexture tex,u_position#,v_position#
<br />
-
<br />
- TurnEntity cube,0.1,0.1,0.1
<br />
-
<br />
- RenderWorld
<br />
-
<br />
- Text 0,0,"Use cursor keys to change uv position values"
<br />
- Text 0,20,"u_position#="+u_position#
<br />
- Text 0,40,"v_position#="+v_position#
<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=PositionTexture&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
- </html>
|