Jump to content
  • Advertisement

zyfu0000

Member
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

122 Neutral

About zyfu0000

  • Rank
    Member
  1. Does anyone know?That has confused me for long time.
  2. Hi everyone, I meet a problem with my 3ds max export plugin developing that I have already searched around but find none answer. I wanna export the animation information,just like the animations' name,its startframe index and its endframe index etc using IGame lib in 3ds max.But I can not make it done.Please help me,thanks.
  3. Oh,good advise,I will have a try. You said you have to use 15 minutes to load only 3 models,oh that's crazy.I thank you may have problems in your loading code.I just sort the vertices by material,then to render. By the way,is it hard to use MAXScript to develop a plugin?Will I need to take much time to learn MAXScript? :)
  4. Appreciate for your reply. 1. I need not to "switch y and z components of every vertex switch y and z components of every normal", because I'm using the "IGame" interface developed by Autodesk for game developers to use.See this: "cm->SetCoordSystem(IGameConversionManager::IGAME_D3D);" It has changed the coordsystem to D3D for me,so that is not the point. As you said "switch the order of drawing for each face: v0 v1 v2 becomes v0 v2 v1 and depending on the texture addressing mode: either subtract V from the integer cieling of the largest V or simply make V negative", I have tried,but it doesn't work. Maybe there is something in my loading and drawing modul.I will check it out.
  5. I developed a plugin for 3dmax to export static model only,it can work well when export some simple models like a phere or a box,but when it turns to more complex models like a teapot etc,it doesn't work well.It looks fragmentized. Please help to look at my code,is there somewhere incorrect? if (m_pGame) { m_pGame->ReleaseIGame(); m_pGame=NULL; } m_pGame=GetIGameInterface(); IGameConversionManager *cm=GetConversionManager(); cm->SetCoordSystem(IGameConversionManager::IGAME_D3D); m_pGame->InitialiseIGame(true); int nodeCount=m_pGame->GetTopLevelNodeCount(); m_nNodes=nodeCount; int materialCount=m_pGame->GetRootMaterialCount(); if (nodeCount==0) { MessageBox(GetActiveWindow(),"No nodes available to export","Realm Engine Exporter",MB_OK|MB_ICONERROR); m_pGame->ReleaseIGame(); return; } for (int nodeIndex=0;nodeIndex<nodeCount;nodeIndex++) { IGameNode *node=m_pGame->GetTopLevelNode(nodeIndex); IGameObject *obj=node->GetIGameObject(); if (obj->GetIGameType()!=IGameMesh::IGAME_MESH) { break; } obj->InitializeData(); IGameMesh *mesh=(IGameMesh*)obj; int vertCount=mesh->GetNumberOfVerts(); m_vertices=(ModelVertex*)realloc(m_vertices,sizeof(ModelVertex)*(m_header.nNumVertices+vertCount)); int faceCount=mesh->GetNumberOfFaces(); m_faces=(ModelFace*)realloc(m_faces,sizeof(ModelFace)*(m_header.nNumFaces+faceCount)); bool flags[65535]={false}; for (int i=0;i<faceCount;i++) { FaceEx *face=mesh->GetFace(i); m_faces[m_header.nNumFaces+i].nMaterialID=(face->matID-1); for (int j=0;j<3;j++) { int k=m_header.nNumVertices+face->vert[j]; m_faces[m_header.nNumFaces+i].nIndices[j]=k; if (flags[face->vert[j]]) { break; } Point3 p=mesh->GetVertex(face->vert[j]); m_vertices[k].fPos[0]=p.x; m_vertices[k].fPos[1]=p.y; m_vertices[k].fPos[2]=p.z; p=mesh->GetNormal(i,j); m_vertices[k].vNormal.x=p.x; m_vertices[k].vNormal.y=p.y; m_vertices[k].vNormal.z=p.z; p=mesh->GetMapVertex(1,face->vert[j]); m_vertices[k].fTexture[0]=p.x; m_vertices[k].fTexture[1]=p.y; flags[face->vert[j]]=true; } } m_header.nNumVertices+=vertCount; m_header.nNumFaces+=faceCount; } I would like to post the screenshot of my model,but I don't know how to post a picture on. Thank you !
  6. Thanks for advise.I do not copy it to my engine.I just learn from it,and use its theory and ways to building engine,and I like its way to organise codes and mudules.Of course,it is not a complete engine,I will build my own. By the way,I have solved the first and the second problems by setting the View and Project matrix up every call to draw the screen.But the third and the fourth I just can not make them out.Need you help.
  7. Of cource,I have set break points to check the view matrix and proj matrix.Unfortunatly,they are all right to meet my calculation acording to the rules in the book. Things are not drawn out if the Z parameter less than 0.0f or larger than 1.0f.
  8. 1.In the Render() function of the application using SetView3D(): HRESULT CD3D::SetView3D(const RealmVector &vRight,const RealmVector &vUp,const RealmVector &vDir,const RealmVector &vPos) { if (!m_bRunning) { return Realm_FAIL; } m_matView3D._14=0.0f; m_matView3D._24=0.0f; m_matView3D._34=0.0f; m_matView3D._44=1.0f; m_matView3D._11=vRight.x; m_matView3D._21=vRight.y; m_matView3D._31=vRight.z; m_matView3D._41=-(vRight*vPos); m_matView3D._12=vUp.x; m_matView3D._22=vUp.y; m_matView3D._32=vUp.z; m_matView3D._42=-(vUp*vPos); m_matView3D._13=vDir.x; m_matView3D._23=vDir.y; m_matView3D._33=vDir.z; m_matView3D._43=-(vDir*vPos); if (FAILED(m_pD3dDevice->SetTransform(D3DTS_VIEW,(D3DXMATRIX*)&m_matView3D))) { return Realm_FAIL; } CalculateViewProjMatrix(); CalculateWorldViewProjMatrix(); if (m_bUseShaders) { D3DXMATRIX *matView=(D3DXMATRIX*)&m_matView3D; SetEffectConstant(DAT_MATRIX,"g_matView",matView); } return Realm_OK; } 2.I used this to set my FVF : #define D3DFVF_VERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1) 3.The sphere is just a model I export from 3DMAX using my own plungin for exporting. 4.Sorry,I dont know how to post a picture on.Just like something a texture in the dense fog. Thanks for replying.
  9. zyfu0000

    Untitled

    I have post the following in the forum "DirectX and XNA",but I think I have posted it in the wrong place,so hear goes. It is several months since I began to write my own engine(I call it Realm Engine) with the help of the ZFX Engine in the book <3D Game Engine Programing>.By now,I have completed several modules. But there maybe four faults in it,so I come to you all for help. 1. When I use the code SetView3D() or SetViewLookAt() to set the camera,it doesn't work even after I change the the Right,Up,Pos,Dir vector. What's worst,the sentence D3DXMatrixLookAtLH() doesn't work,either.Is there somewhere I have set it wrong? 2. I try to draw a triangle in the application.But if I set the parameter Z of vertexs' position less than 0.0f or larger than 1.0f,it woun't be drawn to the screen.I know it must be culled by the frustum,but I set it 1.0f---1000.0f using SetClipPlanes(1.0f,1000.0f); 3. When I try to draw a sphere in the application,a ellipse comes out instead of the sphere with its X-axis extended.So I have to scale the world matrix to keep its shape to still be a sphere.It mybe the aspect in the perspective projection matrix or the scale between width/height of the backbuffer,but I have checked it very carefully find nothing. 4. When I apply a texture to a triangle,its color in texture will be coved by the material.The texture just can be seen blurry,but you can see it for sure.And the texture looks lowering. Those four problems puzzle me for two weeks,but I cannot solve it.So please think about them.Thanks a lot!
  10. Hi, It is several months since I began to write my own engine(I call it Realm Engine) with the help of the ZFX Engine in the book <3D Game Engine Programing>.By now,I have completed several modules. But there maybe four faults in it,so I come to you all for help. 1. When I use the code SetView3D() or SetViewLookAt() to set the camera,it doesn't work even after I change the the Right,Up,Pos,Dir vector. What's worst,the sentence D3DXMatrixLookAtLH() doesn't work,either.Is there somewhere I have set it wrong? 2. I try to draw a triangle in the application.But if I set the parameter Z of vertexs' position less than 0.0f or larger than 1.0f,it woun't be drawn to the screen.I know it must be culled by the frustum,but I set it 1.0f---1000.0f using SetClipPlanes(1.0f,1000.0f); 3. When I try to draw a sphere in the application,a ellipse comes out instead of the sphere with its X-axis extended.So I have to scale the world matrix to keep its shape to still be a sphere.It mybe the aspect in the perspective projection matrix or the scale between width/height of the backbuffer,but I have checked it very carefully find nothing. 4. When I apply a texture to a triangle,its color in texture will be coved by the material.The texture just can be seen blurry,but you can see it for sure.And the texture looks lowering. Those four problems puzzle me for two weeks,but I cannot solve it.So please think about them.Thanks a lot!
  11. Hi, I meet a problem with my 3ds max export plugin developing that I have already searched around but find none answer. I wanna export the animation information,just like the animations' name,its startframe index and its endframe index etc using IGame lib in 3ds max.But I can not make it done.Please help me,thanks.
  12. 3Q,by the reason of being in China,I have taken an hour to download it.Thanks a lot.
  13. Hi,there I'm a little douted about the book <shaders for game programing and artists> in chapter 6.But the CD-ROM with the book has disappeared.So is there someone kind to tell me how i can get the source code.Thank you very much.
  • 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!