Garry's Mod Wiki

Revision Difference

IMesh:Draw#524870

<function name="Draw" parent="IMesh" type="classfunc"> <description>Renders the mesh with the active matrix.</description> <realm>Client</realm> </function> <example> <description> Properly renders the mesh using the SENT's model matrix. ⤶ &lt;pre class="inline"&gt;self.Mesh&lt;/pre&gt; in this case is the <page>IMesh</page>. ⤶ `self.Mesh` in this case is the <page>IMesh</page>. </description> <code> 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 </code> </example>