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
C-/C++-Quelltext |
|
1 |
m_Mesh->LockVertexBuffer(D3DLOCK_READONLY, (LPVOID*)&pVertices); |
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 |
meshSpaceship->Optimize(D3DXMESHOPT_ATTRSORT, NULL, NULL, NULL, NULL, &meshSpaceship); DWORD dwTableSize = 0; D3DXATTRIBUTERANGE *pAttribTable = new D3DXATTRIBUTERANGE [dwTableSize]; if (FAILED (meshSpaceship->GetAttributeTable (pAttribTable, &dwTableSize))) { //assert (0==1); } void* pVertices = NULL; struct sboundbox { D3DXVECTOR3 MinBounds; D3DXVECTOR3 MaxBounds; }; sboundbox boundbox[dwTableSize]; meshSpaceship->LockVertexBuffer(D3DLOCK_READONLY, (LPVOID*)&pVertices); for(i = 0; i < dwTableSize; i++) { D3DXComputeBoundingBox( (D3DXVECTOR3*)pAttribTable[i].VertexStart, pAttribTable[i].VertexCount, D3DXGetFVFVertexSize(m_dwFVF), &boundbox[i].MinBounds, &boundbox[i].MaxBounds); } meshSpaceship->UnlockVertexBuffer(); |
C-/C++-Quelltext |
|
1 |
sboundbox boundbox[dwTableSize]; |
C-/C++-Quelltext |
|
1 2 3 4 5 |
D3DXComputeBoundingBox( (D3DXVECTOR3*)pAttribTable[i].VertexStart, pAttribTable[i].VertexCount, ----> D3DXGetFVFVertexSize(m_dwFVF), <------ &boundbox[i].MinBounds, &boundbox[i].MaxBounds); |
Zitat
sizeof(sboundbox)
C-/C++-Quelltext |
|
1 |
sboundbox boundbox[dwTableSize]; |
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 |
meshSpaceship->Optimize(D3DXMESHOPT_ATTRSORT, NULL, NULL, NULL, NULL, &meshSpaceship); DWORD dwTableSize = 0; D3DXATTRIBUTERANGE *pAttribTable = new D3DXATTRIBUTERANGE [dwTableSize]; if (FAILED (meshSpaceship->GetAttributeTable (pAttribTable, &dwTableSize))) { //assert (0==1); } meshSpaceship->LockVertexBuffer(D3DLOCK_READONLY, (LPVOID*)&pAttribTable); for(i = 0; i < dwTableSize; i++) { D3DXComputeBoundingBox( (D3DXVECTOR3*)pAttribTable[i].VertexStart, pAttribTable[i].VertexCount, sizeof(sboundbox), &boundbox[i].MinBounds, &boundbox[i].MaxBounds); } meshSpaceship->UnlockVertexBuffer(); |
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 |
meshSpaceship->Optimize(D3DXMESHOPT_ATTRSORT, NULL, NULL, NULL, NULL, &meshSpaceship); //meshSpaceship->GetAttributeTable(0, &dwTableSize); D3DXATTRIBUTERANGE *pAttribTable = new D3DXATTRIBUTERANGE [dwTableSize]; if (FAILED (meshSpaceship->GetAttributeTable(pAttribTable, &dwTableSize))) { assert (0==1); } VOID* pvoid; test = pAttribTable[0].VertexStart; meshSpaceship->LockVertexBuffer(D3DLOCK_READONLY, (LPVOID*)&pvoid); for(i = 0; i < dwTableSize; i++) { D3DXComputeBoundingBox((D3DXVECTOR3*)pvoid, pAttribTable[i].VertexCount, meshSpaceship->GetFVF(), &boundbox[i].MinBounds, &boundbox[i].MaxBounds); } meshSpaceship->UnlockVertexBuffer(); |
C-/C++-Quelltext |
|
1 2 3 4 5 |
void GetBoundingBoxValues(D3DXVECTOR3 *array[8], D3DXVECTOR3 minBounds, D3DXVECTOR3 maxBounds) { // We have min and max values, use these to get the 8 corners of the bounding box *array[0] = D3DXVECTOR3( minBounds.x, minBounds.y, minBounds.z ); // xyz ..... |
C-/C++-Quelltext |
|
1 |
GetBoundingBoxValues(&boundboxlines, boundbox[0].MinBounds, boundbox[0].MaxBounds); |
C-/C++-Quelltext |
|
1 |
D3DXVECTOR3 boundboxlines[8];
|
Zitat
GetBoundingBoxValues' : Konvertierung des Parameters 1 von 'struct D3DXVECTOR3 (*)[8]' in 'struct D3DXVECTOR3 *[]' nicht moeglich
Zitat von »"PatrickB"«
Was muss ich jetzt genau ändern? Kenne mich mit Arrays als Zeiger noch nicht so aus. Gegoogelt hab ich schon, aber nix passendes gefunden.
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
meshModel->GetAttributeTable(pAttribTable, &dwTableSize); VOID* pvoid; boundbox = new sboundbox[dwTableSize]; meshModel->LockVertexBuffer(D3DLOCK_READONLY, (LPVOID*)&pvoid); for(i = 0; i < dwTableSize; i++) { D3DXComputeBoundingBox((D3DXVECTOR3*)pvoid, pAttribTable[i].VertexCount, D3DXGetFVFVertexSize(meshModel->GetFVF()), &boundbox[i].MinBounds, &boundbox[i].MaxBounds); } meshModel->UnlockVertexBuffer(); |
Werbeanzeige