Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Zitat von »"valuetest-programm"«
Anzahl Subsets: 3
VBStart: 0
VBCount : 28
IBStart: 0
IBCount: 78
textur: Woo08.bmp
VBStart: 28
VBCount : 285
IBStart: 26
IBCount: 1584
textur: Struk0Y.bmp
VBStart: 313
VBCount : 285
IBStart: 26
IBCount: 1584
textur: Struk0X.bmp
C-/C++-Quelltext |
|
1 2 3 4 5 6 |
lpPreMesh->Optimize( D3DXMESHOPT_ATTRSORT | D3DXMESHOPT_VERTEXCACHE, reinterpret_cast<DWORD*>(lpAdjacency->GetBufferPointer()), NULL, NULL,NULL, &lpMesh); |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
BOOL mnModel::Render() { // Variables LPDIRECT3DDEVICE9 lpDevice = mnDirect3D::GetSingleton()->GetDevice(); // Setzt den Vertexbuffer if(FAILED(lpDevice->SetStreamSource(0, m_lpVertexBuffer->GetVB(), 0, 32)))return FALSE; // Setzt den Indexbuffer if(FAILED(lpDevice->SetIndices(m_lpIndexBuffer->GetIB()))) return FALSE; // Setzt Inputlayout if(FAILED(lpDevice->SetVertexDeclaration(m_lpInputLayout))) return FALSE; //Effekt vorbereiten SetPerRenderConstants(); //Alle Subsets rendern for (DWORD i=0;i<m_iSubsetCount;i++) { //Per Subset Konstanten setzen SetPerSubsetConstants(i); //Technik setzen m_lpEffect->SetTechnique(m_lpSubset[i].sTechniqueName); m_lpEffect->BeginEffect(); m_lpEffect->BeginPass(0); lpDevice->DrawIndexedPrimitive( D3DPT_TRIANGLELIST, m_lpSubset[i].iVertexStart, 0, m_lpSubset[i].iVertexCount, m_lpSubset[i].iIndexStart, m_lpSubset[i].iIndexCount / 3); //Fertig rendern m_lpEffect->EndPass(); m_lpEffect->EndEffect(); } return TRUE; } |
Zitat von »"microsoft-forum"«
had this problem a while ago too with simple boxes and spheres... M$ asked for my models to look at, but never got back to me (I assume because the models were fine and they couldn't figure out why D3DXLoadMeshFrom) would fail on them, and why only sometimes MeshViewer and the other new viewer could only display them sometimes...).
I have come to the conclusion that D3DXLoadMeshFromX is not a very advanced function, and while using 3D Max 7 has fixed a lot of my problems, I am currently rewriting my mesh code to use the examples shown in SkinnedMesh. I hope that works, and honestly, I hope M$ takes us seriously for a change. There *is* a problem with D3DXLoadMeshFromX. Period.
Zitat von »"drakon"«
Wie sieht denn dein FVF aus?
C-/C++-Quelltext |
|
1 2 3 4 5 |
D3DVERTEXELEMENT9 ele[] = { { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, { 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, { 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, D3DDECL_END(),}; |
Werbeanzeige