Garry's Mod Wiki

Revision Difference

IMesh:Draw#517874

<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. ⤶ &amp;lt;pre class="inline"&amp;gt;self.Mesh&amp;lt;/pre&amp;gt; in this case is the <page>IMesh</page>. ⤶ &lt;pre class="inline"&gt;self.Mesh&lt;/pre&gt; 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>