mesh.Quad

From GMod Wiki

Jump to: navigation, search
Function
Syntax mesh.Quad( Vector corner1, Vector corner2, Vector corner3, Vector corner4 )
Where is this used?
Description:
Pushes four vertexes that define a quad.
Returns: nil
Part of Library: mesh
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Mesh.Quad]Mesh.Quad [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionDraws a quad.
Used onNewerClient.png
Code
 
function ENT:Draw( )
 
	self:DrawModel( );
 
	local matrix = Matrix( );
	matrix:Translate( self:GetPos( ) );
	matrix:Rotate( self:GetAngles( ) );
 
	cam.PushModelMatrix( matrix );
 
		render.SetMaterial( Material( "models/shiny" ) );
 
		mesh.Begin( MATERIAL_QUADS, 1 );
 
			mesh.Quad(
				Vector( -32, 32, 0 ),
				Vector( 32, 32, 0 ),
				Vector( 32, -32, 0 ),
				Vector( -32, -32, 0 )
			);
 
		mesh.End( );
 
	cam.PopModelMatrix( );
 
end
OutputA quad.


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox