• rendering client side model
    9 replies, posted
How can I draw the players face on the screen? Almost like I'm using DModelPanel and set the vectors to their face. Is there any way to do it without using a DModelPanel?
Just look at the DModelPanel code.
I don't think there is, and if there is, i doubt it is different then DModelPanel.
[QUOTE=Overv;26941546]Just look at the DModelPanel code.[/QUOTE] ok [editline]24th December 2010[/editline] What should I do about the accesor funcs? [lua] AccessorFunc( PANEL, "m_fAnimSpeed", "AnimSpeed" ) AccessorFunc( PANEL, "Entity", "Entity" ) AccessorFunc( PANEL, "vCamPos", "CamPos" ) AccessorFunc( PANEL, "fFOV", "FOV" ) AccessorFunc( PANEL, "vLookatPos", "LookAt" ) AccessorFunc( PANEL, "colAmbientLight", "AmbientLight" ) AccessorFunc( PANEL, "colColor", "Color" ) AccessorFunc( PANEL, "bAnimated", "Animated" ) [/lua] because the DModelPanel code uses some of those (obviously), and I don't think I can just copy paste them over, can I?
No and you aren't supposed to. Look at the damn code.
[QUOTE=c-unit;26941682]ok [editline]24th December 2010[/editline] What should I do about the accesor funcs? [lua] AccessorFunc( PANEL, "m_fAnimSpeed", "AnimSpeed" ) AccessorFunc( PANEL, "Entity", "Entity" ) AccessorFunc( PANEL, "vCamPos", "CamPos" ) AccessorFunc( PANEL, "fFOV", "FOV" ) AccessorFunc( PANEL, "vLookatPos", "LookAt" ) AccessorFunc( PANEL, "colAmbientLight", "AmbientLight" ) AccessorFunc( PANEL, "colColor", "Color" ) AccessorFunc( PANEL, "bAnimated", "Animated" ) [/lua] because the DModelPanel code uses some of those (obviously), and I don't think I can just copy paste them over, can I?[/QUOTE] Look at the code and see what it does with those functions, if you're just doing one thing with it you wont need all of them.
[QUOTE=Feihc;26954301]Look at the code and see what it does with those functions, if you're just doing one thing with it you wont need all of them.[/QUOTE] Well the only thing I don't understand is how they work, because about 5 lines later after that code is when most are used, so I don't quite understand where they are told what to mean.
You don't need AccessorFuncs since you can simply set the variables manually. LOOK AT THE CODE.
[QUOTE=iRzilla;26960674]Initialize a ClientsideModel once in a non-rendering hook: [lua] myEntity = ClientsideModel(strModelName, RENDER_GROUP_OPAQUE_ENTITY ) myEntity:SetNoDraw( true ) [/lua] Then in a rendering hook simply start a 3D camera, position is correctly and draw the model: [lua] local x, y = self:LocalToScreen( 0, 0 ) cam.Start3D( self.vCamPos, (self.vLookatPos-self.vCamPos):Angle(), self.fFOV, x, y, self:GetWide(), self:GetTall() ) cam.IgnoreZ( true ) self.Entity:DrawModel() render.SuppressEngineLighting( false ) cam.IgnoreZ( false ) cam.End3D() [/lua][/QUOTE] thanks
Sorry, you need to Log In to post a reply to this thread.