Jump to content

  • Log In with Google      Sign In   
  • Create Account


Asesh

Member Since 01 Sep 2006
Offline Last Active Mar 17 2014 10:03 AM
-----

Topics I've Started

[SOLVED] Transformation matrices of individual subsets of an x file

22 November 2011 - 09:44 PM

Right now am stuck in collision detection. I have computed bounding boxes of all the subsets of an x file and want to display the bounding boxes of all the subsets along with them. But seems like D3DXComputeBoundingBox computes the bounding box in object space. I want to find out the translation vector or transformation matrices of all the subsets so that I can translate those bounding boxes along with their min and max points for collision detection of individual subsets. I have attached a screen shot, there are three subsets ie 3 boxes which is for testing purposes only. Actually, I will be implementing the same technique for a huge scene but first I have to get this right.

While the bounding box of one subset is bigger than it's corresponding subset in the middle, it's by design because it will be used for sliding
Posted Image
Thanks

embedded Python memory leak

14 November 2011 - 01:53 AM

I have just finished embedding python in my game but every time it causes memory leak:


Detected memory leaks!
Dumping objects ->
{3902} normal block at 0x000000000487A580, 912 bytes long.
Data: < po > 00 00 00 00 00 00 03 70 6F FB FB FB FB FB FB FB
{3900} normal block at 0x0000000004879F40, 912 bytes long.
Data: < po > 00 00 00 00 00 00 03 70 6F FB FB FB FB FB FB FB
...


{354} normal block at 0x00000000027400B0, 262144 bytes long.
Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
{353} normal block at 0x0000000001F1D050, 768 bytes long.
Data: < t x > B0 00 74 02 00 00 00 00 00 00 78 02 00 00 00 00
Object dump complete.

I have just called ::Py_Initialize(); and ::Py_Finalize(); but despite that it's still causing memory leaks. After Googling, seems like am not the only one. Any solution

Accessing vertex data of x files

09 November 2011 - 10:08 AM

Actually am trying to save the vertices, normals and texture coordinates of all the vertices in a mesh but the code below will only save the vertices, normals and texture coordinates of some of the vertices, not all. For eg, if there are 744 vertices in a mesh, an exception occurs after processing 461 vertices that's because of invalid memory access. This is the data type of this mesh:


// Vertex element description for new cloned mesh
D3DVERTEXELEMENT9 oD3DVertexElement[] =
{
{0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, // Position
{0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0}, // Normal
{0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, // Texture
D3DDECL_END()
};

Code to iterate through all the vertices and store the vertex and normal data in vector containers


DWORD dwNumOfMeshVertices = m_pD3DXSceneMesh->GetNumVertices(); // Number of vertices in the mesh
DWORD dwStride = m_pD3DXSceneMesh->GetNumBytesPerVertex(); // Stride per-vertex

// Lock the vertex buffer and obtain a pointer to the vertex data
if(SUCCEEDED((m_pD3DXSceneMesh->LockVertexBuffer(D3DLOCK_READONLY, reinterpret_cast<void **>(&pdwVertexData)))))
{
// Loop through all the vertices and separate the vertices and normals
for(DWORD dwVertex = 0; dwVertex < dwNumOfMeshVertices; dwVertex++)
{
const D3DXVECTOR3 *pD3DXVertex = reinterpret_cast<const D3DXVECTOR3 *>(pdwVertexData); // Vertex
const D3DXVECTOR3 *pD3DXNormal = reinterpret_cast<const D3DXVECTOR3 *>(pdwVertexData + sizeof(D3DXVECTOR3)); // Normal
const D3DXVECTOR2 *pD3DXTexture = reinterpret_cast<const D3DXVECTOR2 *>(pdwVertexData + sizeof(D3DXVECTOR3) + sizeof(D3DXVECTOR3)); // Texture

m_oMeshVertexPositionVector.push_back(*pD3DXVertex); // Save the vertex position
m_oMeshNormalsVector.push_back(*pD3DXNormal); // Save the normal vector

pdwVertexData += dwStride; // Next vertex data
}

m_pD3DXSceneMesh->UnlockVertexBuffer();
}

The vertex stride is 32 bytes so it seems like it's ok. What's wrong with the code? Thanks

OpenGL 3.x/4.x static libraries?

15 October 2011 - 04:25 AM

Where can I get static libraries for OpenGL 3.x/4.x so that I can easily call the OpenGL functions just by linking to it w/o using wglGetProcAddress or GLEW?

PhysX SDK v3 on ATI Radeon HD 5730?

01 September 2011 - 04:12 AM

Is it possible to install and use PhysX SDK v3 on my Radeon HD 5730 so that I can use it in my game? Since, it's an ATI card and not an NVIDIA one...I went to the SDK site and didn't find anything useful regarding system requirements though PhysX system software will only work on NVIDIA cards

PARTNERS