Jump to content
  • Advertisement

icqqq123

Member
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

125 Neutral

About icqqq123

  • Rank
    Member
  1. icqqq123

    3ds max smoothing problem on the same polygons

    There is a weird thing happened. The smoothness of my model in 3ds max and in obj is different. Why is that?   Screen Cap   I have uploaded the screen cap of the obj format screen cap
  2. icqqq123

    3ds max smoothing problem on the same polygons

    Thank you for your videos! I will watch it.
  3. icqqq123

    3ds max smoothing problem on the same polygons

    There is a weird thing happened. The smoothness of my model in 3ds max and in obj is different. Why is that?   Screen Cap
  4. icqqq123

    3ds max smoothing problem on the same polygons

      So I just need to weld all vertices than the problem can be solved? And how can I set the "normal angle" right?   Thanks for your reply
  5. Hi dude, I am a newbie on 3D modeling and I am now trying to model a human body. I have found a sample to learn how to model human body but a problem comes out. After I have modeled my body, which has the same number, and same position of polygons with the sample, I found that the smoothness between my body and the sample are different even I have tuned the smooth group of my body.   Why is that and how can I fix it?   Thanks!   The screen cap (Left is showing the same of polygon and right is showing the different smoothness)
  6. Not really, Frustum set PointIn = FALSE; and Count-- if any part of the box is not contained in the Frustum, but it return TRUE unless Count == 0
  7. Sorry, could you tell me which part perform complete containment checking so that "if the frustum only intersects part of the object, then the object won't be visible to the camera"? Since in the code of [font=monospace]"[/font]AddNode()", it checks if the node is inside the frustum, and checks if it is totally contained inside the frustum. If not totally contained but partially, it will be further divided to 8 or 4 child nodes so that the child nodes are totally contained in side the frustum. I think the logic is correct, but I cannot find out the reason why I get the result shown in the attachment. Below is the code of the construction of the frustum, is there any problem of that? BOOL cFrustum::Construct(cGraphics *Graphics, float ZDistance) { D3DXMATRIX Matrix, matView, matProj; float ZMin, Q; // Error checking if(Graphics == NULL) return FALSE; // Calculate FOV data Graphics->GetDeviceCOM()->GetTransform(D3DTS_PROJECTION, &matProj); if(ZDistance != 0.0f) { // Calculate new projection matrix based on distance provided ZMin = -matProj._43 / matProj._33; Q = ZDistance / (ZDistance - ZMin); matProj._33 = Q; matProj._43 = -Q * ZMin; } Graphics->GetDeviceCOM()->GetTransform(D3DTS_VIEW, &matView); D3DXMatrixMultiply(&Matrix, &matView, &matProj); // Calculate the planes m_Planes[0].a = Matrix._14 + Matrix._13; // Near m_Planes[0].b = Matrix._24 + Matrix._23; m_Planes[0].c = Matrix._34 + Matrix._33; m_Planes[0].d = Matrix._44 + Matrix._43; D3DXPlaneNormalize(&m_Planes[0], &m_Planes[0]); m_Planes[1].a = Matrix._14 - Matrix._13; // Far m_Planes[1].b = Matrix._24 - Matrix._23; m_Planes[1].c = Matrix._34 - Matrix._33; m_Planes[1].d = Matrix._44 - Matrix._43; D3DXPlaneNormalize(&m_Planes[1], &m_Planes[1]); m_Planes[2].a = Matrix._14 + Matrix._11; // Left m_Planes[2].b = Matrix._24 + Matrix._21; m_Planes[2].c = Matrix._34 + Matrix._31; m_Planes[2].d = Matrix._44 + Matrix._41; D3DXPlaneNormalize(&m_Planes[2], &m_Planes[2]); m_Planes[3].a = Matrix._14 - Matrix._11; // Right m_Planes[3].b = Matrix._24 - Matrix._21; m_Planes[3].c = Matrix._34 - Matrix._31; m_Planes[3].d = Matrix._44 - Matrix._41; D3DXPlaneNormalize(&m_Planes[3], &m_Planes[3]); m_Planes[4].a = Matrix._14 - Matrix._12; // Top m_Planes[4].b = Matrix._24 - Matrix._22; m_Planes[4].c = Matrix._34 - Matrix._32; m_Planes[4].d = Matrix._44 - Matrix._42; D3DXPlaneNormalize(&m_Planes[4], &m_Planes[4]); m_Planes[5].a = Matrix._14 + Matrix._12; // Bottom m_Planes[5].b = Matrix._24 + Matrix._22; m_Planes[5].c = Matrix._34 + Matrix._32; m_Planes[5].d = Matrix._44 + Matrix._42; D3DXPlaneNormalize(&m_Planes[5], &m_Planes[5]); return TRUE; } Thanks!
  8. Yes, I am using the frustum to get meshes from octree. I think the Frustum check should be correct as I tried to use a character mesh to perform the same check and the character looked fine. Below is the checking in Frustum: BOOL cFrustum::CheckRectangle(float XCenter, float YCenter, float ZCenter, float XSize, float YSize, float ZSize, BOOL *CompletelyContained) { short i; DWORD TotalIn = 0; // Count the number of points inside the frustum for(i=0;i<6;i++) { DWORD Count = 8; BOOL PointIn = TRUE; // Test all eight points against plane if(D3DXPlaneDotCoord(&m_Planes, &D3DXVECTOR3(XCenter-XSize, YCenter-YSize, ZCenter-ZSize)) < 0.0f) { PointIn = FALSE; Count--; } if(D3DXPlaneDotCoord(&m_Planes, &D3DXVECTOR3(XCenter+XSize, YCenter-YSize, ZCenter-ZSize)) < 0.0f) { PointIn = FALSE; Count--; } if(D3DXPlaneDotCoord(&m_Planes, &D3DXVECTOR3(XCenter-XSize, YCenter+YSize, ZCenter-ZSize)) < 0.0f) { PointIn = FALSE; Count--; } if(D3DXPlaneDotCoord(&m_Planes, &D3DXVECTOR3(XCenter+XSize, YCenter+YSize, ZCenter-ZSize)) < 0.0f) { PointIn = FALSE; Count--; } if(D3DXPlaneDotCoord(&m_Planes, &D3DXVECTOR3(XCenter-XSize, YCenter-YSize, ZCenter+ZSize)) < 0.0f) { PointIn = FALSE; Count--; } if(D3DXPlaneDotCoord(&m_Planes, &D3DXVECTOR3(XCenter+XSize, YCenter-YSize, ZCenter+ZSize)) < 0.0f) { PointIn = FALSE; Count--; } if(D3DXPlaneDotCoord(&m_Planes, &D3DXVECTOR3(XCenter-XSize, YCenter+YSize, ZCenter+ZSize)) < 0.0f) { PointIn = FALSE; Count--; } if(D3DXPlaneDotCoord(&m_Planes, &D3DXVECTOR3(XCenter+XSize, YCenter+YSize, ZCenter+ZSize)) < 0.0f) { PointIn = FALSE; Count--; } // If none contained, return FALSE if(Count == 0) return FALSE; // Update counter if they were all in front of plane TotalIn += (PointIn == TRUE) ? 1:0; } // Store BOOL flag if completely contained if(CompletelyContained != NULL) *CompletelyContained = (TotalIn == 6) ? TRUE:FALSE; return TRUE; } And below is how I construct the node in octree: void cNodeTreeMesh::AddNode(sNode *Node) { unsigned long i, Group; sPolygon *Polygon; short Num; if(Node == NULL) return; // Perform frustum check based on tree type BOOL CompletelyContained = FALSE; if(m_TreeType == QUADTREE) { if(m_Frustum->CheckRectangle( Node->XPos, 0.0f, Node->ZPos, Node->Size / 2.0f, m_Size / 2.0f, Node->Size / 2.0f, &CompletelyContained) == FALSE) return; } else { if(m_Frustum->CheckRectangle( Node->XPos, Node->YPos, Node->ZPos, Node->Size / 2.0f, Node->Size / 2.0f, Node->Size / 2.0f, &CompletelyContained) == FALSE) return; } if(CompletelyContained == FALSE) { // Scan other nodes Num = 0; for(i=0;i<(unsigned long)((m_TreeType==QUADTREE)?4:8);i++) { if(Node->Nodes != NULL) { Num++; AddNode(Node->Nodes); } } // Don't need to go on if there was other nodes if(Num) return; } // Add contained polygons (if any) if(Node->NumPolygons != 0) { for(i=0;i<Node->NumPolygons;i++) { // Get pointer to polygon Polygon = &m_Polygons[Node->PolygonList]; // Only draw if not done already this frame if(Polygon->Timer != m_Timer) { // Set polygon as processed this frame Polygon->Timer = m_Timer; // Get material group of polygon Group = Polygon->Group; // Make sure group is okay and material is not transparent if(Group < m_NumGroups && m_Mesh->m_Materials[Group].Diffuse.a != 0.0f) { // Copy indices into index buffer *m_Groups[Group].IndexPtr++ = Polygon->Vertex0; *m_Groups[Group].IndexPtr++ = Polygon->Vertex1; *m_Groups[Group].IndexPtr++ = Polygon->Vertex2; // Increase count of polygons to draw in group m_Groups[Group].NumPolygonsToDraw++; } } } } } Thanks a lot!
  9. Dear all, I have read a book called Programming RPG with DirectX recently and I find a problem on using the quadtree provided by the book. When I loaded my level using the class cNodeTree in the book, I found that my level was displayed very weird, for example, part of the level disappeared. I have checked the code but I cannot find which piece of code wrong. Therefore, is there any people who have read that book can help me? Thanks! PS. attached is a screen shot of my program, you can see that there is missing part of the castle and the grass.
  10. I strongly suggest aggressive batching. I've been doing about 50k easy vertices with easy pixel shaders at about 60 fps for ages. If your level complexity is 2004 or earlier, you can probably draw it completely with no issues at all. If your level is as complex as 2001 or earlier, you can probably draw it a few times and still hit 60 fps. What's your problem exactly? Portals and antiportals are ... not trivial at the very least. I'd leave them as a last resource. No, it is wrong. First, you're going to aim two guns at your feet. Second, the bounding box is only one of the various collision shapes available, you need at the very least box, sphere and hull. Third, characters ("kinematic" objects) are a problem by themselves, they are game-dependant and even context-dependant, they are o not-trivial problem even on top of an existing collision library. [/quote] Thanks for your advice. But what are the meanings of 2004 and 2001? So, what I need to do to deal with the collision between character and game level? Thanks
  11. Thanks for the advices! For the collision part, if I want to implement by myself, is it right that I need to create bounding boxes for all of my objects in my level, so that I can detect collision between characters and level like I detect it among characters? Thanks
  12. Hi everyone! I have just joined this forum and I have questions about how to render 3d game level and collision detection. I have already created a few 2d games and now I want to start to create a 3d game. The first problem I encounter is I don't know how to render a game level efficiently. Now, I just load the whole level to my game and render it, but the performance is not quite good. How do I optimize it? Second question is how can I detect collision with the level, say I have a character and I want to have collision detection between character and the game level? I know how to detect collision between characters, but is the idea of collision with game level similar to collision with other characters? Thanks!
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!