90 lines
2.1 KiB
HTML
90 lines
2.1 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>BrushTexture brush,texture[,frame][,index]</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
brush - brush handle
|
|
<br />
|
|
texture - texture handle
|
|
<br />
|
|
frame (optional) - texture frame. Defaults to 0.
|
|
<br />
|
|
index (optional) - texture index. Defaults to 0.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
Assigns a texture to a brush.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
The optional frame parameter specifies which animation frame, if any exist, should be assigned to the brush.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
The optional index parameter specifies texture layer that the texture should be assigned to. Brushes have up to four texture layers, 0-3 inclusive.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../3d_examples/BrushTexture.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
; BrushTexture 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 />
|
|
; Create brush
|
|
<br />
|
|
brush=CreateBrush()
|
|
<br />
|
|
|
|
<br />
|
|
; Apply texture to brush
|
|
<br />
|
|
BrushTexture brush,tex
|
|
<br />
|
|
|
|
<br />
|
|
; Paint mesh with brush
|
|
<br />
|
|
PaintMesh cube,brush
|
|
<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 cube,pitch#,yaw#,roll#
|
|
<br />
|
|
|
|
<br />
|
|
RenderWorld
|
|
<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=BrushTexture&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
|
|
</html>
|