Files
BlitzNext/_release/help/commands/3d_commands/CreateSurface.htm
T
2014-12-08 12:43:20 +13:00

59 lines
1.5 KiB
HTML

<html>
<head>
<title>Blitz3D Docs</title>
<link rel=stylesheet href=../css/commands.css type=text/css>
</head>
<body>
<h1>CreateSurface ( mesh[,brush] )</h1>
<h1>Parameters</h1>
<table>
<tr>
<td>
mesh - mesh handle
<br />
brush (optional) - brush handle
</td>
</tr>
</table>
<h1>Description</h1>
<table>
<tr>
<td>
Creates a surface attached to a mesh and returns the surface's handle.
<br />
<br />
Surfaces are sections of mesh which are then used to attach triangles to. You must have at least one surface per mesh in order to create a visible mesh, however you can use as many as you like. Splitting a mesh up into lots of sections allows you to affect those sections individually, which can be a lot more useful than if all the surfaces are combined into just one.
</td>
</tr>
</table>
<h1><a href=../3d_examples/CreateSurface.bb>Example</a></h1>
<table>
<tr>
<td>
Graphics3D 640,480
<br />
SetBuffer BackBuffer()
<br />
<br />
mesh = CreateMesh()
<br />
surf = CreateSurface(mesh)
<br />
<br />
v0 = AddVertex (surf, -5,-5,0, 0 ,0)
<br />
v1 = AddVertex (surf, 5,-5,0, 1 ,0)
<br />
v2 = AddVertex (surf, 0, 5,0, 0.5,1)
<br />
<br />
tri = AddTriangle (surf,v0,v2,v1)
<br />
<br />
cam = CreateCamera()
<br />
MoveEntity cam, 0,0,-7
<br />
<br />
RenderWorld
<br />
Flip
<br />
<br />
WaitKey
<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=CreateSurface&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
</html>