86 lines
2.4 KiB
HTML
86 lines
2.4 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>EntityTexture entity,texture[,frame][,index]</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
entity - entity handle
|
|
<br />
|
|
texture - texture handle
|
|
<br />
|
|
frame (optional) - frame of texture. Defaults to 0.
|
|
<br />
|
|
index (optional) - index number of texture. Should be in the range to 0-7. Defaults to 0.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
Applies a texture to an entity.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
The optional frame parameter specifies which texture animation frame should be used as the texture.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
The optional index parameter specifies which index number should be assigned to the texture. Index numbers are used for the purpose of multitexturing. See TextureBlend.
|
|
|
|
<br />
|
|
|
|
<br />
|
|
A little note about multitexturing and slowdown. Graphics cards support a maximum amount of textures per object, which can be used with very little, if any, slowdown. For most cards this is two, but for a GeForce3 it is four. However, once you use more than this amount, Blitz will emulate the effect itself by duplicating objects and textures. Obviously, this may then cause slowdown.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../3d_examples/EntityTexture.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
; EntityTexture 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 entity
|
|
<br />
|
|
EntityTexture cube,tex
|
|
<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=EntityTexture&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
|
|
</html>
|