Talk:Models on VGUI Panels: Difference between revisions
mNo edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
::Hmm odd then because when I tried to implement this in my MP mod as quoted I got nothing but compiler errors and complaints about unknown classes. | ::Hmm odd then because when I tried to implement this in my MP mod as quoted I got nothing but compiler errors and complaints about unknown classes. | ||
this may be done in the skeletal SDK...it's not too hard to extract what you need from this tho: | |||
<pre> // Now draw it. | |||
CViewSetup view; | |||
// setup the views location, size and fov (amongst others) | |||
view.x = x; | |||
view.y = y; | |||
view.width = width; | |||
view.height = height; | |||
view.m_bOrtho = false; | |||
view.fov = 54; | |||
view.origin = origin + Vector( -110, -5, -5 ); | |||
// make sure that we see all of the player model | |||
Vector vMins, vMaxs; | |||
pPlayerModel->C_BaseAnimating::GetRenderBounds( vMins, vMaxs ); | |||
view.origin.z += ( vMins.z + vMaxs.z ) * 0.55f; | |||
view.angles.Init(); | |||
view.m_vUnreflectedOrigin = view.origin; | |||
view.zNear = VIEW_NEARZ; | |||
view.zFar = 1000; | |||
view.m_bForceAspectRatio1To1 = false; | |||
// render it out to the new CViewSetup area | |||
// it's possible that ViewSetup3D will be replaced in future code releases | |||
Frustum dummyFrustum; | |||
render->ViewSetup3D( &view, dummyFrustum ); | |||
pPlayerModel->DrawModel( STUDIO_RENDER ); | |||
if ( pWeaponModel ) | |||
{ | |||
pWeaponModel->DrawModel( STUDIO_RENDER ); | |||
} | |||
</pre> |
Revision as of 14:02, 12 March 2006
How big of a footprint does this take over just rendering the model itself? I can think of some really nifty original things to do with being able to drop models in my VGUI but I don't wanna kill the system. Angry Beaver 23:33, 11 Mar 2006 (PST)
Is this a single player Mod thing or is there any way to get it to work with HL2DM SDK based mods too? I know several Mods, including my own, that have wanted to use models in menus so I'd like to get this working. I did have some success but had to re-write some parts but couldn't get the latter part to compile at all. I assume it dependancies but I couldn't figure out what was missing exactly. -- Wunderboy 07:54, 12 Mar 2006 (PST)
- Hidden: Source is a multiplayer mod—ts2do 11:26, 12 Mar 2006 (PST)
- Hmm odd then because when I tried to implement this in my MP mod as quoted I got nothing but compiler errors and complaints about unknown classes.
this may be done in the skeletal SDK...it's not too hard to extract what you need from this tho:
// Now draw it. CViewSetup view; // setup the views location, size and fov (amongst others) view.x = x; view.y = y; view.width = width; view.height = height; view.m_bOrtho = false; view.fov = 54; view.origin = origin + Vector( -110, -5, -5 ); // make sure that we see all of the player model Vector vMins, vMaxs; pPlayerModel->C_BaseAnimating::GetRenderBounds( vMins, vMaxs ); view.origin.z += ( vMins.z + vMaxs.z ) * 0.55f; view.angles.Init(); view.m_vUnreflectedOrigin = view.origin; view.zNear = VIEW_NEARZ; view.zFar = 1000; view.m_bForceAspectRatio1To1 = false; // render it out to the new CViewSetup area // it's possible that ViewSetup3D will be replaced in future code releases Frustum dummyFrustum; render->ViewSetup3D( &view, dummyFrustum ); pPlayerModel->DrawModel( STUDIO_RENDER ); if ( pWeaponModel ) { pWeaponModel->DrawModel( STUDIO_RENDER ); }