TrisRendered()

Blitz3D Forums/Blitz3D Programming/TrisRendered()

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

My code is sort of complicated, but the basic creation code is sort of like this...

	; Create the mesh itself
	
	Mesh = CreateMesh( InCamera )
	
	; Allocate and assign a brush
	
	Wk\BrushID = CreateBrush()
	BrushTexture( Wk\BrushID, InTexture )
	BrushFX( Wk\BrushID, 1+2+16+32 )

	; Give the mesh a surface

	Wk\SurfID = CreateSurface( Mesh )
	PaintSurface( Wk\SurfID, Mesh )


I then add 4 vertices to the surface and create 2 triangles looking something like this...

	vtx0 = AddVertex( InSurf,	 X0, Y0, 0,	U0#,V0# )
	vtx1 = AddVertex( InSurf,	 X1, Y1, 0,	U1#,V0# )
	vtx2 = AddVertex( InSurf,	 X2, Y2, 0,	U0#,V1# )
	vtx3 = AddVertex( InSurf,	 X3, Y3, 0,	U1#,V1# )

	AddTriangle( InSurf, vtx0, vtx1, vtx2 )
	AddTriangle( InSurf, vtx3, vtx2, vtx1 )


Not sure if that hacked up version helps at all... my renderer is kinda large-ish now.