Apparently the model panel is restricted to the X Size of the panel being greater then the Y Size. If the Y goes over the X amount, the model doesn't appear.
As in, this would work:
[CODE]local icon = vgui.Create( "DModelPanel", window )
icon:SetModel( LocalPlayer():GetModel() )
icon:SetSize( 150, 150 )
icon:SetCamPos( Vector( 70, 80, 60 ) )
icon:SetLookAt( Vector( 0, 0, 0 ) )[/CODE]
But this won't:
[CODE]local icon = vgui.Create( "DModelPanel", window )
icon:SetModel( LocalPlayer():GetModel() )
icon:SetSize( 150, 50 )
icon:SetCamPos( Vector( 70, 80, 60 ) )
icon:SetLookAt( Vector( 0, 0, 0 ) )[/CODE]
Is there any easy way to make the Y size bigger then the X's, but still allowing it to display the panel?
If not, is there any other way to display a model on a panel?
Just put the DModelPanel in a regular DPanel.
That way you can position and size as you wish, making it appear as if the DModelPanel has the dimensions you wish.
[lua]
local Pan = vgui.Create( "DPanel", F )
Pan:SetPos( 220, 30 )
Pan:SetSize( 270, 360 )
local CurModel = vgui.Create( "DModelPanel", Pan )
CurModel:SetPos( -35, 0 )
CurModel:SetSize( 400, 400 )
[/lua]
The reason your panel isn't rendering is that it MUST be square. To do otherwise will require you to write your own rendering function.
Sorry, you need to Log In to post a reply to this thread.