lucky6969b

Members
  • Content count

    1580
  • Joined

  • Last visited

Community Reputation

1330 Excellent

About lucky6969b

  • Rank
    Contributor

Personal Information

  • Interests
    Art
  1. The navigation mesh I've built on the "staircase" geometry is an inclined ramp. When walking up, I need to find the foot pivot on the navigation mesh or the pure geometry. How do you guys know where the foot pivots are? Currently, I am just get the current foot position, add up an arbitrary value and the leg ik swings into action, and that's it.... I run out of ways to locate the foot pivot in the scene... Thanks Jack
  2. 3D Can't Validate a mesh [pic attached]

    When a mesh contains some degenerative faces, how do I get rid of them programatically? I don't care if they are intentional lines or things like that. I am just testing it.
  3. Hello, When calling on a specific mesh to validate, it can't pass the function. However, other meshes go okay, just that one. I am using D3DXValidMesh function
  4. When the mesh has just got the positions and normals, it can't generate a progressive mesh. What other prerequisites are required to generate a progressive mesh? Thanks Jack
  5. As you batch up a lot of game objects into one mesh, say it's a LOD mesh, and there is a mountain very far away, and you don't need a lot of details for that... as you've batched that mesh into a one mesh, that one mesh must have the same detail level as the mesh that is really close to the camera... We have saved a lot of draw calls from that, but does it worth it to render the far distanced mountain with high poly count? Thanks Jack
  6. Genus Calculation again.

    Thanks JoeJ, Finally got it to work.... The solution is as what you've suggested, cloning the mesh without the UVs.... Thanks my project is coming to an end now....
  7. Genus Calculation again.

    Still not sure why, the assimp would load a 8-vertex submesh into a 24-vertex entity? It's got 12 faces and 24 vertexes Oh yeah, solid cube mesh!!!!
  8. Genus Calculation again.

    One of these could be the problem, I don't know which. The "Blind_Block" has genus of 0, but some other planar mesh still reports 24 vertexes, it is actually a box, Funny enough is when I opened the obj file, it has 8 vertexes in that part? #define aiProcessPreset_TargetRealtime_Quality ( \ aiProcess_CalcTangentSpace | \ aiProcess_GenSmoothNormals | \ aiProcess_JoinIdenticalVertices | \ aiProcess_ImproveCacheLocality | \ aiProcess_LimitBoneWeights | \ aiProcess_RemoveRedundantMaterials | \ aiProcess_SplitLargeMeshes | \ aiProcess_Triangulate | \ aiProcess_GenUVCoords | \ aiProcess_SortByPType | \ aiProcess_FindDegenerates | \ aiProcess_FindInvalidData | \ 0 )
  9. Genus Calculation again.

    Hello, I know now, because I got a wack exporter that doesn't support vertex duplication elimination. The vertex count is 24 for a box, .... But what does it mean to have a genus of -2?
  10. Genus Calculation again.

    Hello JoeJ, If that is the case, did I just find the right result? That is a box mesh.... (not a plane with a hole in the middle this time), it has a genus of 4. Thanks Jack
  11. I apologize first as I lost track of the previous posting for this topic. I am wondering how do I calculate the genus of a mesh. For instance, if I got a box, just a plain-vanilla box, and if I use the following formula, I will get a genus of 6.... I believe it's wrong. int genus = verts.size() + faces.size() - edges.size(); Blind_Block Genus: 6 When using this one: int genus = (2 + (verts.size() + faces.size() - edges.size())) / 2; I would get: Blind_Block Genus: 4
  12. In the code snippet below, the static mesh I am adding to the engine always falls below zero. If the transform is at y zero, why would the bounding volume has a negative y value in it? Thanks Jack ////////////////////////////// /// AddStaticMesh void PhysicsMover::addStaticMesh(LPD3DXMESH pMesh) { btBvhTriangleMeshShape* staticShape = NULL; Transform* l_transform = m_simObject->FindComponentByType<Transform>(); DWORD numFaces = pMesh->GetNumFaces(); DWORD numIndices = numFaces * 3; if (numIndices < 65535) { typedef unsigned short IndexFormat; btTriangleIndexVertexArray* indexVertexArrays = new btTriangleIndexVertexArray(); LPDIRECT3DVERTEXBUFFER9 pVertices; pMesh->GetVertexBuffer(&pVertices); DWORD dwVertexSize = pMesh->GetNumBytesPerVertex(); DWORD dwNumVerts = pMesh->GetNumVertices(); BYTE* pVertexData; pVertices->Lock(0, 0, (void**)&pVertexData, 0); LPDIRECT3DINDEXBUFFER9 pIndices; pMesh->GetIndexBuffer(&pIndices); BYTE* pIndexData; pIndices->Lock(0, 0, (void**)&pIndexData, 0); btIndexedMesh iMesh; iMesh.m_numTriangles = pMesh->GetNumFaces(); iMesh.m_triangleIndexBase = (const unsigned char *)pIndexData; iMesh.m_triangleIndexStride = 3 * sizeof(IndexFormat); iMesh.m_numVertices = dwNumVerts; iMesh.m_vertexBase = (const unsigned char *)pVertexData; iMesh.m_vertexStride = sizeof(D3DXVECTOR3); indexVertexArrays->addIndexedMesh( iMesh, PHY_SHORT ); // For non-moving objects only staticShape = new btBvhTriangleMeshShape(indexVertexArrays, true); m_collisionShapes.push_back(staticShape); pIndices->Unlock(); pVertices->Unlock(); } else { typedef DWORD IndexFormat; btTriangleIndexVertexArray* indexVertexArrays = new btTriangleIndexVertexArray(); LPDIRECT3DVERTEXBUFFER9 pVertices; pMesh->GetVertexBuffer(&pVertices); DWORD dwVertexSize = pMesh->GetNumBytesPerVertex(); DWORD dwNumVerts = pMesh->GetNumVertices(); BYTE* pVertexData; pVertices->Lock(0, 0, (void**)&pVertexData, 0); LPDIRECT3DINDEXBUFFER9 pIndices; pMesh->GetIndexBuffer(&pIndices); BYTE* pIndexData; pIndices->Lock(0, 0, (void**)&pIndexData, 0); indexVertexArrays = new btTriangleIndexVertexArray(pMesh->GetNumFaces(), (int*)pIndexData, 3 * sizeof(int), pMesh->GetNumVertices(), (btScalar*)pVertexData, dwVertexSize); // For non-moving objects only staticShape = new btBvhTriangleMeshShape(indexVertexArrays, true); m_collisionShapes.push_back(staticShape); pIndices->Unlock(); pVertices->Unlock(); } // collision shapes are attached to transforms and not coupled to meshes themselves btTransform startTransform; startTransform.setIdentity(); D3DXVECTOR3 ori = l_transform->getPosition(); if (m_simObject->m_name=="Warehouse3") { startTransform.setOrigin(btVector3(ori.x, ori.y, ori.z)); } else { //startTransform.setOrigin(btVector3(ori.x, // 0, ori.z)); // the floor of the warehouse1 has fallen by 0.17 meters startTransform.setOrigin(btVector3(ori.x, ori.y, ori.z)); } AgentMotionState* myMotionState = new AgentMotionState(m_simObject); myMotionState->setWorldTransform(startTransform); btRigidBody::btRigidBodyConstructionInfo cInfo(0, myMotionState, staticShape); btRigidBody* body = new btRigidBody(cInfo); body->setContactProcessingThreshold(m_defaultContactProcessingThreshold); btVector3 bmin, bmax; staticShape->getAabb(startTransform, bmin, bmax); m_dynamicsWorld->addRigidBody(body); }
  13. What is the general practice in dealing with LOD/Progressive Meshes? 1) Do I change the number of faces in the meshes according to the distance to the camera? 2) Do I keep a regular version of the mesh, then a progressive version? 3) If I was to keep 2 versions, when is the appropriate time to switch meshes? Thanks Jack
  14. Normal question

    Yep, vinterberq made my day... Thanks Jack
  15. Normal question

    If I had a quad which consists of 2 tris, when I work out their face normals, why one would face up, the other face down? DWORD numVerts = pMesh->GetNumVertices(); DWORD numTris = pMesh->GetNumFaces(); VertexPN* v = NULL; DWORD* id = NULL; std::vector<VertexPN> verts; pMesh->LockVertexBuffer(0, (void**)&v); for (int i = 0; i < numVerts; i++) { const VertexPN& _v = v[i]; verts.push_back(_v); } pMesh->UnlockVertexBuffer(); pMesh->LockIndexBuffer(0, (void**)&id); for (int i = 0; i < numTris; i++) { const VertexPN& v0 = verts[id[i*3+0]]; const VertexPN& v1 = verts[id[i*3+1]]; const VertexPN& v2 = verts[id[i*3+2]]; D3DXVECTOR3 faceNormal; D3DXVec3Cross(&faceNormal, &v0.pos, &v1.pos); if (faceNormal.y > 0) { TRACE("Face #" << i << " is up" << "\n"); ChangeAttrib(i, 246); } TRACE("Face #: " << i << " normal is y:" << faceNormal.y << "\n"); } pMesh->UnlockIndexBuffer();