|
You last visited: Today at 06:29
Advertisement
[Help] Model Viewer Source
Discussion on [Help] Model Viewer Source within the Flyff Private Server forum part of the Flyff category.
11/04/2020, 04:12
|
#1
|
elite*gold: 0
Join Date: Oct 2020
Posts: 20
Received Thanks: 0
|
[Help] Model Viewer Source
EDIT:- NOW I HAVE THIS PROBLEM
-https://imgur.com/a/eFxekr4
I copied a model view source from other source. but when I tried compiling. it gave me an error.
-Error 1 error C2065: 'TEXT_MODEL_VIEW' : undeclared identifier E:\Flyff\Source\_Interface\FuncApplet.cpp 532 1 Neuz
-
#ifdef __MODEL_VIEW
AddAppletFunc( AppMain_ModelView, APP_MODEL_VIEW, _T( "WndModsManager" ), _T( "Icon_Applet.dds" ), TEXT_MODEL_VIEW, 0, TEXT_MODEL_VIEW );
#endif // __MODEL_VIEW
can anyone help me please? thank you!
|
|
|
11/04/2020, 04:57
|
#2
|
elite*gold: 0
Join Date: Jun 2009
Posts: 65
Received Thanks: 46
|
Your hint is this part: TEXT_MODEL_VIEW
Check the Resource area, you most likely didn't define it there.
Resdata files should bring the "Oh" moment after investigating them.
|
|
|
11/04/2020, 12:30
|
#3
|
elite*gold: 0
Join Date: Oct 2020
Posts: 20
Received Thanks: 0
|
Hello! I got to rebuilt the solution with no errors. I also go ingame, double click in wiki. the window pops out, but the characters body is missing, and the models are not loading.. I have no idea why this is. please help me! thanks guys!
Also, there are no error logs anywhere to be found. please help!
|
|
|
11/04/2020, 16:55
|
#4
|
elite*gold: 0
Join Date: Jul 2018
Posts: 224
Received Thanks: 46
|
Quote:
Originally Posted by TheRealMadara
Hello! I got to rebuilt the solution with no errors. I also go ingame, double click in wiki. the window pops out, but the characters body is missing, and the models are not loading.. I have no idea why this is. please help me! thanks guys!
Also, there are no error logs anywhere to be found. please help!
|
Your source has _LOOKCHANGE system?
|
|
|
11/04/2020, 18:33
|
#5
|
elite*gold: 0
Join Date: Oct 2020
Posts: 20
Received Thanks: 0
|
Quote:
Originally Posted by LookAtTheFlower
Your source has _LOOKCHANGE system?
|
Hello! yes I have _LOOKCHANGE and __LOOKCHANGE_PET
I looked at the system __LOOKCHANGE and I looked at moverequip.cpp, also I cannot find wndmodelview.cpp anywhere!. all i can see is CWndModelView. and theres a lot of them I dont know what to do. honestly I do not know what Im looking for. feels bad not knowing source
|
|
|
11/05/2020, 07:37
|
#6
|
elite*gold: 0
Join Date: Jul 2018
Posts: 224
Received Thanks: 46
|
Quote:
Originally Posted by TheRealMadara
Hello! yes I have _LOOKCHANGE and __LOOKCHANGE_PET
I looked at the system __LOOKCHANGE and I looked at moverequip.cpp, also I cannot find wndmodelview.cpp anywhere!. all i can see is CWndModelView. and theres a lot of them I dont know what to do. honestly I do not know what Im looking for. feels bad not knowing source 
|
From another forum:
__LOOKCHANGE has to be added to model view that's why the body is missing.
Not my code but you can use this as a guide:
Code:
#include "stdafx.h"
#include "WndModelView.h"
#include "ResData.h"
#include "defineObj.h"
#include "DPClient.h"
extern CDPClient g_DPlay;
#ifdef __MODEL_VIEW
CWndModelView::CWndModelView( void )
{
m_pTexture = NULL;
m_pModel = NULL;
m_bLButtonDownRot = FALSE;
m_bRButtonDownTrans = FALSE;
m_fRotX = 0.0f;
m_fRotY = 0.0f;
m_fTransX = 0.0f;
m_fTransY = -0.6f;
m_fScale = 1.2f;
}
CWndModelView::~CWndModelView( void )
{
m_pTexture = NULL;
SAFE_DELETE(m_pModel);
}
BOOL CWndModelView::Process()
{
if( m_pModel )
m_pModel->FrameMove();
return TRUE;
}
BOOL CWndModelView::Initialize( CWndBase* pWndParent, DWORD dwType )
{
return CWndNeuz::InitDialog( g_Neuz.GetSafeHwnd(), APP_MODEL_VIEW, WBS_THICKFRAME, CPoint( 0, 0 ), pWndParent );
}
void CWndModelView::SetWndRect(CRect rectWnd, BOOL bOnSize)
{
AdjustMinRect(&rectWnd, 288, 208);
AdjustMaxRect(&rectWnd, 640, 640);
CWndNeuz::SetWndRect(rectWnd, bOnSize);
}
void CWndModelView::OnSize(UINT nType, int cx, int cy)
{
CWndNeuz::OnSize(nType, cx, cy);
}
void CWndModelView::OnDraw( C2DRender* p2DRender )
{
if( m_pModel == NULL )
return;
bool isMover = g_pPlayer->GetIndex() == m_dwIndex;
LPDIRECT3DDEVICE9 pd3dDevice = p2DRender->m_pd3dDevice;
// ¨¬a¨¡¡À¨¡¢ç ¨ù¨ù¨¡A
D3DVIEWPORT9 viewport;
viewport.X = p2DRender->m_ptOrigin.x + 5;//100;// + 5;
viewport.Y = p2DRender->m_ptOrigin.y + 5;// + 5;
viewport.Width = p2DRender->m_clipRect.Width() - 100;//105;
viewport.Height = 182;//p2DRender->m_clipRect.Height() - 200;
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
DWORD dwColor1 = D3DCOLOR_ARGB( 100, 0, 0, 0 );//D3DCOLOR_TEMP( 255, 0, 0, 50 );//
DWORD dwColor2 = D3DCOLOR_ARGB( 255, 240, 240, 240 );//D3DCOLOR_TEMP( 255, 80, 80, 120 );//
DWORD dwColor3 = D3DCOLOR_ARGB( 100, 200, 200, 200 );//D3DCOLOR_TEMP( 255, 80, 80, 120 );//
pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW );
pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, FALSE );
pd3dDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pd3dDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
pd3dDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pd3dDevice->SetRenderState( D3DRS_AMBIENT, D3DCOLOR_ARGB( 255, 255,255,255) );
CRect rect = GetClientRect();
// ¨¬a¨¡¡À¨¡¢ç ¨ù¨ù¨¡A
D3DXMATRIXA16 matWorld;
D3DXMATRIXA16 matScale;
D3DXMATRIXA16 matRotX;
D3DXMATRIXA16 matRotY;
D3DXMATRIXA16 matTrans;
// A¡ì¢¬¨*¢Òo
D3DXMATRIX matView;
D3DXVECTOR3 vecLookAt( 0.0f, 0.0f, 3.0f );
D3DXVECTOR3 vecPos( 0.0f, 0.7f, -3.5f );
D3DXMatrixLookAtLH( &matView, &vecPos, &vecLookAt, &D3DXVECTOR3(0.0f,1.0f,0.0f) );
pd3dDevice->SetTransform( D3DTS_VIEW, &matView );
#ifdef __YENV
D3DXVECTOR3 vDir( 0.0f, 0.0f, 1.0f );
SetLightVec( vDir );
#endif //__YENV
// ¢¯¨*AE ¢¯©ª¨¬¡í ¢¬©£¥ì¡§ ¡¤¡Ì¢¥o¢¬¥ì
{
/*LPWNDCTRL lpFace = GetWndCtrl( WIDC_CUSTOM1 );
viewport.X = p2DRender->m_ptOrigin.x + lpFace->rect.left;
viewport.Y = p2DRender->m_ptOrigin.y + lpFace->rect.top;
viewport.Width = lpFace->rect.Width();
viewport.Height = lpFace->rect.Height();*/
viewport.X = p2DRender->m_ptOrigin.x + 16;
viewport.Y = p2DRender->m_ptOrigin.y + 16;
viewport.Width = rect.Width() - 32;
viewport.Height = rect.Height() - 32;
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
pd3dDevice->SetViewport(&viewport);
pd3dDevice->Clear(0, NULL, D3DCLEAR_ZBUFFER, 0xffa08080, 1.0f, 0 ) ;
D3DXMATRIX matProj;
D3DXMatrixIdentity( &matProj );
FLOAT fAspect = ((FLOAT)viewport.Width) / (FLOAT)viewport.Height;
/*
D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4.0f, fAspect, CWorld::m_fNearPlane - 0.01f, CWorld::m_fFarPlane );
pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
*/
FLOAT fov = D3DX_PI/4.0f;//796.0f;
FLOAT h = cos(fov/2) / sin(fov/2);
FLOAT w = h * fAspect;
D3DXMatrixOrthoLH( &matProj, w, h, CWorld::m_fNearPlane - 0.01f, CWorld::m_fFarPlane );
pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
D3DXMatrixIdentity(&matScale);
D3DXMatrixIdentity(&matRotX);
D3DXMatrixIdentity(&matRotY);
D3DXMatrixIdentity(&matTrans);
D3DXMatrixIdentity(&matWorld);
D3DXMatrixRotationY(&matRotX, D3DXToRadian(m_fRotX));
D3DXMatrixRotationX(&matRotY, D3DXToRadian(m_fRotY));
D3DXMatrixScaling(&matScale, m_fScale, m_fScale, m_fScale);
D3DXMatrixTranslation(&matTrans,m_fTransX,m_fTransY,0.0f);
D3DXMatrixMultiply(&matWorld, &matWorld, &matScale);
D3DXMatrixMultiply(&matWorld, &matWorld, &matRotX);
D3DXMatrixMultiply(&matWorld, &matWorld, &matRotY);
D3DXMatrixMultiply(&matWorld, &matWorld, &matTrans );
pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
// ¡¤¡Ì¢¥o¢¬¥ì
pd3dDevice->SetRenderState( D3DRS_FOGENABLE, FALSE );
pd3dDevice->SetRenderState( D3DRS_LIGHTING, FALSE );//m_bViewLight );
::SetLight( FALSE );
::SetFog( FALSE );
SetDiffuse( 1.0f, 1.0f, 1.0f );
SetAmbient( 1.0f, 1.0f, 1.0f );
if (isMover)
{
m_pModel->GetObject3D(PARTS_HAIR)->m_fAmbient[0] = g_pPlayer->m_fHairColorR;
m_pModel->GetObject3D(PARTS_HAIR)->m_fAmbient[1] = g_pPlayer->m_fHairColorG;
m_pModel->GetObject3D(PARTS_HAIR)->m_fAmbient[2] = g_pPlayer->m_fHairColorB;
}
D3DXVECTOR4 vConst( 1.0f, 1.0f, 1.0f, 1.0f );
#ifdef __YENV
g_Neuz.m_pEffect->SetVector( g_Neuz.m_hvFog, &vConst );
#else //__YENV
pd3dDevice->SetVertexShaderConstantF( 95, (float*)&vConst, 1 );
#endif //__YENV
::SetTransformView( matView );
::SetTransformProj( matProj );
if (isMover)
{
m_Mover.OverCoatItemRenderCheck(m_pModel);
// Ci¢¬aAI ¢¬O¢¬¢çA¡ì¢Òo ©ø?¡¤A¨ú©¬CI¢¥A¡ÆIAI©øA? // AI¨¬¡ÍAI ¨ú©ª¢¥A¡Æ©¡¢¯i
DWORD dwId = m_Mover.m_aEquipInfo[PARTS_CAP].dwId;;
#ifdef __LOOKCHANGE
if (m_Mover.m_aEquipInfo[PARTS_CAP].dwLook != NULL_ID)
dwId = m_Mover.m_aEquipInfo[PARTS_CAP].dwLook;
#endif
O3D_ELEMENT* pElement = NULL;
ItemProp* pItemProp = NULL;
if( dwId != NULL_ID )
{
pItemProp = prj.GetItemProp( dwId );
if( pItemProp && pItemProp->dwBasePartsIgnore != -1 )
{
pElement = m_pModel->SetEffect(pItemProp->dwBasePartsIgnore, XE_HIDE );
}
// ¢¯UAoAC¡íoA¡í AO¨úuA¡í¡Æ©¡¢¯i ¢¬O¢¬¢ç©ø?¢¬¡¾¡ÆIAI¡Æ¢®AC ¡¾aA¨ªA¡í ¢¯UAo ¢¬©£AU¢¬| ¡¾aA¨ªA¢¬¡¤I ©öU©÷U¢¥U
dwId = m_Mover.m_aEquipInfo[PARTS_HAT].dwId;
#ifdef __LOOKCHANGE
if (m_Mover.m_aEquipInfo[PARTS_HAT].dwLook != NULL_ID)
dwId = m_Mover.m_aEquipInfo[PARTS_HAT].dwLook;
#endif
if( dwId != NULL_ID )
{
if( !(m_Mover.m_aEquipInfo[PARTS_HAT].byFlag & CItemElem::expired) )
{
pItemProp = prj.GetItemProp( dwId );
if( pItemProp && pItemProp->dwBasePartsIgnore != -1 )
{
if( pItemProp->dwBasePartsIgnore == PARTS_HEAD )
((CModelObject*)m_pModel)->SetEffect(PARTS_HAIR, XE_HIDE );
((CModelObject*)m_pModel)->SetEffect(pItemProp->dwBasePartsIgnore, XE_HIDE );
}
else
{
if( pElement )
pElement->m_nEffect &= ~XE_HIDE;
}
}
}
}
else
{
// ¢¯UAoAC¡íoA¡í AO¨úuA¡í¡Æ©¡¢¯i ¢¬O¢¬¢ç©ø?¢¬¡¾¡ÆIAI¡Æ¢®AC ¡¾aA¨ªA¡í ¢¯UAo ¢¬©£AU¢¬| ¡¾aA¨ªA¢¬¡¤I ©öU©÷U¢¥U
dwId = m_Mover.m_aEquipInfo[PARTS_HAT].dwId;
#ifdef __LOOKCHANGE
if (m_Mover.m_aEquipInfo[PARTS_HAT].dwLook != NULL_ID)
dwId = m_Mover.m_aEquipInfo[PARTS_HAT].dwLook;
#endif
if( dwId != NULL_ID )
{
if( !(m_Mover.m_aEquipInfo[PARTS_HAT].byFlag & CItemElem::expired) )
{
pItemProp = prj.GetItemProp( dwId );
if( pItemProp && pItemProp->dwBasePartsIgnore != -1 )
{
if( pItemProp->dwBasePartsIgnore == PARTS_HEAD )
((CModelObject*)m_pModel)->SetEffect(PARTS_HAIR, XE_HIDE );
((CModelObject*)m_pModel)->SetEffect(pItemProp->dwBasePartsIgnore, XE_HIDE );
}
}
}
}
m_pModel->GetObject3D(PARTS_HAIR)->m_fAmbient[0] = g_pPlayer->m_fHairColorR;
m_pModel->GetObject3D(PARTS_HAIR)->m_fAmbient[1] = g_pPlayer->m_fHairColorG;
m_pModel->GetObject3D(PARTS_HAIR)->m_fAmbient[2] = g_pPlayer->m_fHairColorB;
}
else
{
m_pModel->SetTextureEx(m_pModel->m_pModelElem->m_nTextureEx);
}
m_pModel->SetGroup( 0 );
m_pModel->Render( p2DRender->m_pd3dDevice, &matWorld );
}
return;
}
void CWndModelView::OnInitialUpdate( void )
{
CWndNeuz::OnInitialUpdate();
RestoreDeviceObjects();
MoveParentCenter();
InitMoverModel();
}
void CWndModelView::InitMoverModel()
{
for (int i = 0; i < MAX_HUMAN_PARTS; ++i)
{
if (g_pPlayer->GetEquipItem(i))
{
m_Mover.m_aEquipInfo[i].dwId = g_pPlayer->GetEquipItem(i)->m_dwItemId;
#ifdef __LOOKCHANGE
m_Mover.m_aEquipInfo[i].dwLook = NULL_ID;
#endif
}
}
InitModel(g_pPlayer->GetIndex());
CMover::UpdateParts(g_pPlayer->GetSex(), g_pPlayer->m_dwSkinSet, g_pPlayer->m_dwFace, g_pPlayer->m_dwHairMesh, g_pPlayer->m_dwHeadMesh, m_Mover.m_aEquipInfo, m_pModel, NULL);
}
void CWndModelView::InitModel(DWORD dwIndex)
{
m_dwIndex = dwIndex;
SAFE_DELETE(m_pModel);
//if (dwIndex == g_pPlayer->GetIndex())
{
m_pModel = (CModelObject*)prj.m_modelMng.LoadModel(g_Neuz.m_pd3dDevice, OT_MOVER, dwIndex, dwIndex == g_pPlayer->GetIndex());
prj.m_modelMng.LoadMotion(m_pModel, OT_MOVER, dwIndex, MTI_STAND);
m_pModel->InitDeviceObjects(g_Neuz.GetDevice());
}
}
void CWndModelView::OnLButtonDown(UINT nFlags, CPoint point)
{
SetCapture();
//if( GetWndCtrl(WIDC_CUSTOM1)->rect.PtInRect(point) )
{
m_ptOld = point;
m_bLButtonDownRot = TRUE;
}
}
void CWndModelView::OnLButtonUp(UINT nFlags, CPoint point)
{
ReleaseCapture();
m_bLButtonDownRot = FALSE;
}
void CWndModelView::OnRButtonDown(UINT nFlags, CPoint point)
{
SetCapture();
//if (GetWndCtrl(WIDC_CUSTOM1)->rect.PtInRect(point))
{
m_ptOld = point;
m_bRButtonDownTrans = TRUE;
}
}
void CWndModelView::OnRButtonUp(UINT nFlags, CPoint point)
{
ReleaseCapture();
m_bRButtonDownTrans = FALSE;
}
void CWndModelView::OnMouseMove(UINT nFlags, CPoint point)
{
if( m_bLButtonDownRot )
{
m_fRotX += (m_ptOld.x - point.x) * 0.75f;
m_fRotY += (m_ptOld.y - point.y) * 0.75f;
m_ptOld = point;
}
else if (m_bRButtonDownTrans)
{
m_fTransX += (m_ptOld.x - point.x) * 0.01f;
m_fTransY -= (m_ptOld.y - point.y) * 0.01f;
m_ptOld = point;
}
}
BOOL CWndModelView::OnMouseWheel(UINT flags, short zDelta, CPoint pt)
{
if (zDelta < 0)
{
m_fScale -= 0.1f;
}
else
{
m_fScale += 0.1f;
}
return CWndNeuz::OnMouseWheel(flags, zDelta, pt);
}
bool CWndModelView::SetPart(ItemProp *pProp)
{
bool result = false;
if( pProp )
{
if (pProp->dwParts >= 2 && pProp->dwParts < MAX_HUMAN_PARTS)
{
if (m_dwIndex != g_pPlayer->GetIndex())
{
InitMoverModel();
}
if (pProp->dwItemSex == NULL_ID || g_pPlayer->GetSex() == pProp->dwItemSex)
{
int nArryEquip1[5] = { PARTS_CAP, PARTS_UPPER_BODY, PARTS_HAND, PARTS_FOOT, PARTS_CLOAK };
int nArryEquip2[5] = { PARTS_HAT, PARTS_CLOTH, PARTS_GLOVE, PARTS_BOOTS, PARTS_CLOAK2 };
for (int i = 0; i < 5; ++i)
{
if (pProp->dwParts == nArryEquip1[i])
{
m_Mover.m_aEquipInfo[nArryEquip2[i]].dwId = NULL_ID;
#ifdef __LOOKCHANGE
m_Mover.m_aEquipInfo[nArryEquip2[i]].dwLook = NULL_ID;
#endif
break;
}
if (pProp->dwParts == nArryEquip2[i])
{
m_Mover.m_aEquipInfo[nArryEquip1[i]].dwId = NULL_ID;
#ifdef __LOOKCHANGE
m_Mover.m_aEquipInfo[nArryEquip1[i]].dwLook = NULL_ID;
#endif
break;
}
}
m_Mover.m_aEquipInfo[pProp->dwParts].dwId = pProp->dwID;
#ifdef __LOOKCHANGE
m_Mover.m_aEquipInfo[pProp->dwParts].dwLook = NULL_ID;
#endif
{
CMover::UpdateParts(g_pPlayer->GetSex(), g_pPlayer->m_dwSkinSet, g_pPlayer->m_dwFace, g_pPlayer->m_dwHairMesh, g_pPlayer->m_dwHeadMesh, m_Mover.m_aEquipInfo, m_pModel, NULL);
}
result = true;
}
}
else if (pProp->dwItemKind3 == IK3_PET)
{
InitModel(pProp->dwLinkKind);
result = true;
}
}
return result;
}
#endif
|
|
|
11/05/2020, 08:02
|
#7
|
elite*gold: 0
Join Date: Oct 2020
Posts: 20
Received Thanks: 0
|
Quote:
Originally Posted by LookAtTheFlower
From another forum:
__LOOKCHANGE has to be added to model view that's why the body is missing.
Not my code but you can use this as a guide:
Code:
#include "stdafx.h"
#include "WndModelView.h"
#include "ResData.h"
#include "defineObj.h"
#include "DPClient.h"
extern CDPClient g_DPlay;
#ifdef __MODEL_VIEW
CWndModelView::CWndModelView( void )
{
m_pTexture = NULL;
m_pModel = NULL;
m_bLButtonDownRot = FALSE;
m_bRButtonDownTrans = FALSE;
m_fRotX = 0.0f;
m_fRotY = 0.0f;
m_fTransX = 0.0f;
m_fTransY = -0.6f;
m_fScale = 1.2f;
}
CWndModelView::~CWndModelView( void )
{
m_pTexture = NULL;
SAFE_DELETE(m_pModel);
}
BOOL CWndModelView::Process()
{
if( m_pModel )
m_pModel->FrameMove();
return TRUE;
}
BOOL CWndModelView::Initialize( CWndBase* pWndParent, DWORD dwType )
{
return CWndNeuz::InitDialog( g_Neuz.GetSafeHwnd(), APP_MODEL_VIEW, WBS_THICKFRAME, CPoint( 0, 0 ), pWndParent );
}
void CWndModelView::SetWndRect(CRect rectWnd, BOOL bOnSize)
{
AdjustMinRect(&rectWnd, 288, 208);
AdjustMaxRect(&rectWnd, 640, 640);
CWndNeuz::SetWndRect(rectWnd, bOnSize);
}
void CWndModelView::OnSize(UINT nType, int cx, int cy)
{
CWndNeuz::OnSize(nType, cx, cy);
}
void CWndModelView::OnDraw( C2DRender* p2DRender )
{
if( m_pModel == NULL )
return;
bool isMover = g_pPlayer->GetIndex() == m_dwIndex;
LPDIRECT3DDEVICE9 pd3dDevice = p2DRender->m_pd3dDevice;
// ¨¬a¨¡¡À¨¡¢ç ¨ù¨ù¨¡A
D3DVIEWPORT9 viewport;
viewport.X = p2DRender->m_ptOrigin.x + 5;//100;// + 5;
viewport.Y = p2DRender->m_ptOrigin.y + 5;// + 5;
viewport.Width = p2DRender->m_clipRect.Width() - 100;//105;
viewport.Height = 182;//p2DRender->m_clipRect.Height() - 200;
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
DWORD dwColor1 = D3DCOLOR_ARGB( 100, 0, 0, 0 );//D3DCOLOR_TEMP( 255, 0, 0, 50 );//
DWORD dwColor2 = D3DCOLOR_ARGB( 255, 240, 240, 240 );//D3DCOLOR_TEMP( 255, 80, 80, 120 );//
DWORD dwColor3 = D3DCOLOR_ARGB( 100, 200, 200, 200 );//D3DCOLOR_TEMP( 255, 80, 80, 120 );//
pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
pd3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW );
pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, FALSE );
pd3dDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pd3dDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
pd3dDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
pd3dDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );
pd3dDevice->SetRenderState( D3DRS_AMBIENT, D3DCOLOR_ARGB( 255, 255,255,255) );
CRect rect = GetClientRect();
// ¨¬a¨¡¡À¨¡¢ç ¨ù¨ù¨¡A
D3DXMATRIXA16 matWorld;
D3DXMATRIXA16 matScale;
D3DXMATRIXA16 matRotX;
D3DXMATRIXA16 matRotY;
D3DXMATRIXA16 matTrans;
// A¡ì¢¬¨*¢Òo
D3DXMATRIX matView;
D3DXVECTOR3 vecLookAt( 0.0f, 0.0f, 3.0f );
D3DXVECTOR3 vecPos( 0.0f, 0.7f, -3.5f );
D3DXMatrixLookAtLH( &matView, &vecPos, &vecLookAt, &D3DXVECTOR3(0.0f,1.0f,0.0f) );
pd3dDevice->SetTransform( D3DTS_VIEW, &matView );
#ifdef __YENV
D3DXVECTOR3 vDir( 0.0f, 0.0f, 1.0f );
SetLightVec( vDir );
#endif //__YENV
// ¢¯¨*AE ¢¯©ª¨¬¡í ¢¬©£¥ì¡§ ¡¤¡Ì¢¥o¢¬¥ì
{
/*LPWNDCTRL lpFace = GetWndCtrl( WIDC_CUSTOM1 );
viewport.X = p2DRender->m_ptOrigin.x + lpFace->rect.left;
viewport.Y = p2DRender->m_ptOrigin.y + lpFace->rect.top;
viewport.Width = lpFace->rect.Width();
viewport.Height = lpFace->rect.Height();*/
viewport.X = p2DRender->m_ptOrigin.x + 16;
viewport.Y = p2DRender->m_ptOrigin.y + 16;
viewport.Width = rect.Width() - 32;
viewport.Height = rect.Height() - 32;
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
pd3dDevice->SetViewport(&viewport);
pd3dDevice->Clear(0, NULL, D3DCLEAR_ZBUFFER, 0xffa08080, 1.0f, 0 ) ;
D3DXMATRIX matProj;
D3DXMatrixIdentity( &matProj );
FLOAT fAspect = ((FLOAT)viewport.Width) / (FLOAT)viewport.Height;
/*
D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4.0f, fAspect, CWorld::m_fNearPlane - 0.01f, CWorld::m_fFarPlane );
pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
*/
FLOAT fov = D3DX_PI/4.0f;//796.0f;
FLOAT h = cos(fov/2) / sin(fov/2);
FLOAT w = h * fAspect;
D3DXMatrixOrthoLH( &matProj, w, h, CWorld::m_fNearPlane - 0.01f, CWorld::m_fFarPlane );
pd3dDevice->SetTransform( D3DTS_PROJECTION, &matProj );
D3DXMatrixIdentity(&matScale);
D3DXMatrixIdentity(&matRotX);
D3DXMatrixIdentity(&matRotY);
D3DXMatrixIdentity(&matTrans);
D3DXMatrixIdentity(&matWorld);
D3DXMatrixRotationY(&matRotX, D3DXToRadian(m_fRotX));
D3DXMatrixRotationX(&matRotY, D3DXToRadian(m_fRotY));
D3DXMatrixScaling(&matScale, m_fScale, m_fScale, m_fScale);
D3DXMatrixTranslation(&matTrans,m_fTransX,m_fTransY,0.0f);
D3DXMatrixMultiply(&matWorld, &matWorld, &matScale);
D3DXMatrixMultiply(&matWorld, &matWorld, &matRotX);
D3DXMatrixMultiply(&matWorld, &matWorld, &matRotY);
D3DXMatrixMultiply(&matWorld, &matWorld, &matTrans );
pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
// ¡¤¡Ì¢¥o¢¬¥ì
pd3dDevice->SetRenderState( D3DRS_FOGENABLE, FALSE );
pd3dDevice->SetRenderState( D3DRS_LIGHTING, FALSE );//m_bViewLight );
::SetLight( FALSE );
::SetFog( FALSE );
SetDiffuse( 1.0f, 1.0f, 1.0f );
SetAmbient( 1.0f, 1.0f, 1.0f );
if (isMover)
{
m_pModel->GetObject3D(PARTS_HAIR)->m_fAmbient[0] = g_pPlayer->m_fHairColorR;
m_pModel->GetObject3D(PARTS_HAIR)->m_fAmbient[1] = g_pPlayer->m_fHairColorG;
m_pModel->GetObject3D(PARTS_HAIR)->m_fAmbient[2] = g_pPlayer->m_fHairColorB;
}
D3DXVECTOR4 vConst( 1.0f, 1.0f, 1.0f, 1.0f );
#ifdef __YENV
g_Neuz.m_pEffect->SetVector( g_Neuz.m_hvFog, &vConst );
#else //__YENV
pd3dDevice->SetVertexShaderConstantF( 95, (float*)&vConst, 1 );
#endif //__YENV
::SetTransformView( matView );
::SetTransformProj( matProj );
if (isMover)
{
m_Mover.OverCoatItemRenderCheck(m_pModel);
// Ci¢¬aAI ¢¬O¢¬¢çA¡ì¢Òo ©ø?¡¤A¨ú©¬CI¢¥A¡ÆIAI©øA? // AI¨¬¡ÍAI ¨ú©ª¢¥A¡Æ©¡¢¯i
DWORD dwId = m_Mover.m_aEquipInfo[PARTS_CAP].dwId;;
#ifdef __LOOKCHANGE
if (m_Mover.m_aEquipInfo[PARTS_CAP].dwLook != NULL_ID)
dwId = m_Mover.m_aEquipInfo[PARTS_CAP].dwLook;
#endif
O3D_ELEMENT* pElement = NULL;
ItemProp* pItemProp = NULL;
if( dwId != NULL_ID )
{
pItemProp = prj.GetItemProp( dwId );
if( pItemProp && pItemProp->dwBasePartsIgnore != -1 )
{
pElement = m_pModel->SetEffect(pItemProp->dwBasePartsIgnore, XE_HIDE );
}
// ¢¯UAoAC¡íoA¡í AO¨úuA¡í¡Æ©¡¢¯i ¢¬O¢¬¢ç©ø?¢¬¡¾¡ÆIAI¡Æ¢®AC ¡¾aA¨ªA¡í ¢¯UAo ¢¬©£AU¢¬| ¡¾aA¨ªA¢¬¡¤I ©öU©÷U¢¥U
dwId = m_Mover.m_aEquipInfo[PARTS_HAT].dwId;
#ifdef __LOOKCHANGE
if (m_Mover.m_aEquipInfo[PARTS_HAT].dwLook != NULL_ID)
dwId = m_Mover.m_aEquipInfo[PARTS_HAT].dwLook;
#endif
if( dwId != NULL_ID )
{
if( !(m_Mover.m_aEquipInfo[PARTS_HAT].byFlag & CItemElem::expired) )
{
pItemProp = prj.GetItemProp( dwId );
if( pItemProp && pItemProp->dwBasePartsIgnore != -1 )
{
if( pItemProp->dwBasePartsIgnore == PARTS_HEAD )
((CModelObject*)m_pModel)->SetEffect(PARTS_HAIR, XE_HIDE );
((CModelObject*)m_pModel)->SetEffect(pItemProp->dwBasePartsIgnore, XE_HIDE );
}
else
{
if( pElement )
pElement->m_nEffect &= ~XE_HIDE;
}
}
}
}
else
{
// ¢¯UAoAC¡íoA¡í AO¨úuA¡í¡Æ©¡¢¯i ¢¬O¢¬¢ç©ø?¢¬¡¾¡ÆIAI¡Æ¢®AC ¡¾aA¨ªA¡í ¢¯UAo ¢¬©£AU¢¬| ¡¾aA¨ªA¢¬¡¤I ©öU©÷U¢¥U
dwId = m_Mover.m_aEquipInfo[PARTS_HAT].dwId;
#ifdef __LOOKCHANGE
if (m_Mover.m_aEquipInfo[PARTS_HAT].dwLook != NULL_ID)
dwId = m_Mover.m_aEquipInfo[PARTS_HAT].dwLook;
#endif
if( dwId != NULL_ID )
{
if( !(m_Mover.m_aEquipInfo[PARTS_HAT].byFlag & CItemElem::expired) )
{
pItemProp = prj.GetItemProp( dwId );
if( pItemProp && pItemProp->dwBasePartsIgnore != -1 )
{
if( pItemProp->dwBasePartsIgnore == PARTS_HEAD )
((CModelObject*)m_pModel)->SetEffect(PARTS_HAIR, XE_HIDE );
((CModelObject*)m_pModel)->SetEffect(pItemProp->dwBasePartsIgnore, XE_HIDE );
}
}
}
}
m_pModel->GetObject3D(PARTS_HAIR)->m_fAmbient[0] = g_pPlayer->m_fHairColorR;
m_pModel->GetObject3D(PARTS_HAIR)->m_fAmbient[1] = g_pPlayer->m_fHairColorG;
m_pModel->GetObject3D(PARTS_HAIR)->m_fAmbient[2] = g_pPlayer->m_fHairColorB;
}
else
{
m_pModel->SetTextureEx(m_pModel->m_pModelElem->m_nTextureEx);
}
m_pModel->SetGroup( 0 );
m_pModel->Render( p2DRender->m_pd3dDevice, &matWorld );
}
return;
}
void CWndModelView::OnInitialUpdate( void )
{
CWndNeuz::OnInitialUpdate();
RestoreDeviceObjects();
MoveParentCenter();
InitMoverModel();
}
void CWndModelView::InitMoverModel()
{
for (int i = 0; i < MAX_HUMAN_PARTS; ++i)
{
if (g_pPlayer->GetEquipItem(i))
{
m_Mover.m_aEquipInfo[i].dwId = g_pPlayer->GetEquipItem(i)->m_dwItemId;
#ifdef __LOOKCHANGE
m_Mover.m_aEquipInfo[i].dwLook = NULL_ID;
#endif
}
}
InitModel(g_pPlayer->GetIndex());
CMover::UpdateParts(g_pPlayer->GetSex(), g_pPlayer->m_dwSkinSet, g_pPlayer->m_dwFace, g_pPlayer->m_dwHairMesh, g_pPlayer->m_dwHeadMesh, m_Mover.m_aEquipInfo, m_pModel, NULL);
}
void CWndModelView::InitModel(DWORD dwIndex)
{
m_dwIndex = dwIndex;
SAFE_DELETE(m_pModel);
//if (dwIndex == g_pPlayer->GetIndex())
{
m_pModel = (CModelObject*)prj.m_modelMng.LoadModel(g_Neuz.m_pd3dDevice, OT_MOVER, dwIndex, dwIndex == g_pPlayer->GetIndex());
prj.m_modelMng.LoadMotion(m_pModel, OT_MOVER, dwIndex, MTI_STAND);
m_pModel->InitDeviceObjects(g_Neuz.GetDevice());
}
}
void CWndModelView::OnLButtonDown(UINT nFlags, CPoint point)
{
SetCapture();
//if( GetWndCtrl(WIDC_CUSTOM1)->rect.PtInRect(point) )
{
m_ptOld = point;
m_bLButtonDownRot = TRUE;
}
}
void CWndModelView::OnLButtonUp(UINT nFlags, CPoint point)
{
ReleaseCapture();
m_bLButtonDownRot = FALSE;
}
void CWndModelView::OnRButtonDown(UINT nFlags, CPoint point)
{
SetCapture();
//if (GetWndCtrl(WIDC_CUSTOM1)->rect.PtInRect(point))
{
m_ptOld = point;
m_bRButtonDownTrans = TRUE;
}
}
void CWndModelView::OnRButtonUp(UINT nFlags, CPoint point)
{
ReleaseCapture();
m_bRButtonDownTrans = FALSE;
}
void CWndModelView::OnMouseMove(UINT nFlags, CPoint point)
{
if( m_bLButtonDownRot )
{
m_fRotX += (m_ptOld.x - point.x) * 0.75f;
m_fRotY += (m_ptOld.y - point.y) * 0.75f;
m_ptOld = point;
}
else if (m_bRButtonDownTrans)
{
m_fTransX += (m_ptOld.x - point.x) * 0.01f;
m_fTransY -= (m_ptOld.y - point.y) * 0.01f;
m_ptOld = point;
}
}
BOOL CWndModelView::OnMouseWheel(UINT flags, short zDelta, CPoint pt)
{
if (zDelta < 0)
{
m_fScale -= 0.1f;
}
else
{
m_fScale += 0.1f;
}
return CWndNeuz::OnMouseWheel(flags, zDelta, pt);
}
bool CWndModelView::SetPart(ItemProp *pProp)
{
bool result = false;
if( pProp )
{
if (pProp->dwParts >= 2 && pProp->dwParts < MAX_HUMAN_PARTS)
{
if (m_dwIndex != g_pPlayer->GetIndex())
{
InitMoverModel();
}
if (pProp->dwItemSex == NULL_ID || g_pPlayer->GetSex() == pProp->dwItemSex)
{
int nArryEquip1[5] = { PARTS_CAP, PARTS_UPPER_BODY, PARTS_HAND, PARTS_FOOT, PARTS_CLOAK };
int nArryEquip2[5] = { PARTS_HAT, PARTS_CLOTH, PARTS_GLOVE, PARTS_BOOTS, PARTS_CLOAK2 };
for (int i = 0; i < 5; ++i)
{
if (pProp->dwParts == nArryEquip1[i])
{
m_Mover.m_aEquipInfo[nArryEquip2[i]].dwId = NULL_ID;
#ifdef __LOOKCHANGE
m_Mover.m_aEquipInfo[nArryEquip2[i]].dwLook = NULL_ID;
#endif
break;
}
if (pProp->dwParts == nArryEquip2[i])
{
m_Mover.m_aEquipInfo[nArryEquip1[i]].dwId = NULL_ID;
#ifdef __LOOKCHANGE
m_Mover.m_aEquipInfo[nArryEquip1[i]].dwLook = NULL_ID;
#endif
break;
}
}
m_Mover.m_aEquipInfo[pProp->dwParts].dwId = pProp->dwID;
#ifdef __LOOKCHANGE
m_Mover.m_aEquipInfo[pProp->dwParts].dwLook = NULL_ID;
#endif
{
CMover::UpdateParts(g_pPlayer->GetSex(), g_pPlayer->m_dwSkinSet, g_pPlayer->m_dwFace, g_pPlayer->m_dwHairMesh, g_pPlayer->m_dwHeadMesh, m_Mover.m_aEquipInfo, m_pModel, NULL);
}
result = true;
}
}
else if (pProp->dwItemKind3 == IK3_PET)
{
InitModel(pProp->dwLinkKind);
result = true;
}
}
return result;
}
#endif
|
OK thank you flower, I will update this post if somethings up. I will try my best to understand the hint you gave. wish me luck please. Thanks!!
|
|
|
11/05/2020, 10:54
|
#8
|
elite*gold: 0
Join Date: Jul 2018
Posts: 224
Received Thanks: 46
|
Quote:
Originally Posted by TheRealMadara
OK thank you flower, I will update this post if somethings up. I will try my best to understand the hint you gave. wish me luck please. Thanks!!
|
The functions can be found in either WndField.cpp or WndModelView.cpp & .h.
Depends on your code.
|
|
|
11/07/2020, 10:54
|
#9
|
elite*gold: 0
Join Date: Oct 2020
Posts: 20
Received Thanks: 0
|
#include "stdafx.h"
#include "WndModelView.h"
#include "ResData.h"
#include "defineObj.h"
#include "DPClient.h"
extern CDPClient g_DPlay;
where to put this? like literally on top of that //model_view?
thanks. im lost
|
|
|
11/07/2020, 11:30
|
#10
|
elite*gold: 0
Join Date: Jul 2018
Posts: 224
Received Thanks: 46
|
Quote:
Originally Posted by TheRealMadara
#include "stdafx.h"
#include "WndModelView.h"
#include "ResData.h"
#include "defineObj.h"
#include "DPClient.h"
extern CDPClient g_DPlay;
where to put this? like literally on top of that //model_view?
thanks. im lost
|
As i said:
Quote:
The functions can be found in either WndField.cpp or WndModelView.cpp & .h.
Depends on your code.
|
I hope you're not planning on copy&paste the code.
|
|
|
11/07/2020, 14:52
|
#11
|
elite*gold: 0
Join Date: Sep 2020
Posts: 22
Received Thanks: 5
|
You can replace TEXT_MODEL_VIEW with _T("Model Viewer")
|
|
|
11/07/2020, 15:58
|
#12
|
elite*gold: 0
Join Date: Oct 2020
Posts: 20
Received Thanks: 0
|
Quote:
Originally Posted by LookAtTheFlower
As i said:
I hope you're not planning on copy&paste the code.
|
Hello yes, I've been trying to figure this out for days now. and still I get errors while compiling  mine is at WndField.cpp
Quote:
Originally Posted by aqwp
You can replace TEXT_MODEL_VIEW with _T("Model Viewer")
|
Hello again friend! yes I made Model Viewer work. days ago when I was trying to figure out how to make _MODEL_VIEW work. I think _MODEL_VIEW is better because you can just double click the items in wiki and boom you got to see how it looks  ..
the problem is. no matter how hard I try. I cant seem to make _model_view work. its making me stressed out.
here is the pic
|
|
|
11/07/2020, 19:15
|
#13
|
elite*gold: 0
Join Date: Sep 2020
Posts: 22
Received Thanks: 5
|
Check your CWndModelView::InitMoverModel() , your character is not updating correctly
Compare with other sources
|
|
|
11/07/2020, 23:50
|
#14
|
elite*gold: 0
Join Date: Apr 2019
Posts: 81
Received Thanks: 7
|
It's All about the __LOOKCHANGE
|
|
|
11/08/2020, 05:25
|
#15
|
elite*gold: 0
Join Date: Oct 2020
Posts: 20
Received Thanks: 0
|
I wonder which source that is released has this so I can compare it
Quote:
Originally Posted by aqwp
Check your CWndModelView::InitMoverModel() , your character is not updating correctly
Compare with other sources
|
I wonder which source to compare it from? just the wndfield.cpp right?
|
|
|
Similar Threads
|
(HELP ABOUT MODEL TYPE :NO MODEL)
12/08/2015 - Flyff Private Server - 0 Replies
Close Fix
|
[Help] Model Viewer Source Code
07/29/2015 - Flyff Private Server - 9 Replies
Is There Anyone Has A Good Model Viewer Code ?
Can You Help Me With It Please :)
I Want To Make My Own Server <3
Im Not Pro But I Got A Any Ideas For Developing A Private Server :)
I Just Need A Source Code XD
|
Model viewer und model dateien finden und in cinema 4d importieren
09/20/2012 - Aion - 1 Replies
Hallo
Ich würde gerne mir die Aion Models fuer ein anderes Game nehmen und diese in cinema 4d importieren.
Bisher habe ich die .pak datei entpackt und in der dort entstandenen zip datei viele dateien gefunden. Nach suchen bin ich zur erkenntnis gekommen das ie .cgf dateien die model sind (richtig?)
MNun weiss ich aber nicht wie ich mir diese anschauen kann und dann in cinema 4d importieren kann.
gibt es dafuer irgendein tool?
|
All times are GMT +1. The time now is 06:30.
|
|