Garry's Mod Wiki

IMesh:Draw

IMesh:Draw()

Description

Renders the mesh with the active matrix.

If called inside ENTITY:Draw. You need to draw the entity's model before drawing the mesh, for lighting to work properly.

Example

Properly renders the mesh using the SENT's model matrix.

self.Mesh in this case is the IMesh.

local myMaterial = Material( "models/wireframe" ) -- models/debug/debugwhite function ENT:Draw() if ( self.Mesh ) then render.SetMaterial( myMaterial ) cam.PushModelMatrix( self:GetWorldTransformMatrix() ) self.Mesh:Draw() cam.PopModelMatrix() end -- Other code end

Page Links


Special Pages


Wikis

?

Render Time: 42ms

DB GetPage 6
Generate Html 2
SaveChanges (1) 12
Render Body 0
Render Sidebar 19