• Content count

  • Joined

  • Last visited

Community Reputation

120 Neutral

About CreatureNZ

  • Rank

    All dynamic buffers will  need to be reloaded upon losing the device, i. e. a full screen app that you alt tab away from. Until the dynamic buffers have been cleared and reset, the renderer will not render anything.  typically dynamic buffers tend to be things like particle effects, fonts, any of the ID3DX objects. 
  2. I have a few easy questions about game development. (noob)

    I have just completed my first year in a software engineering degree specialising in game development. The books that we mostly used through out the year were: Beginning C++ Through Game Programming (Third Edition) Beginning DirectX 9 3D Math Primer for Graphics and Game Development   Although we used the books a lot, there are many areas where they are lacking and I would have struggled without the support that my lecturers provided. If you are serious about game design and development as a career, perhaps you should consider a similar course.  hopefully that helps
  3. Collision detection

    If you have your rendering working, start by creating and drawing to objects in the world/scene. ID3DXmeshs are nice and quick to create. If you can do that, try moving them around the world independently of each other. Once you have that working, create some very basic collision tests using spheres.   if the distance between the two spheres is less than the sum of the radii squared, the objects are colliding.   Fantastic article about collision tests.   Once you have this working, you can use it to further improve your collision test accuracy.   D3DXIntersect is used to test a ray (3D vector) against a ID3DXmesh, i recently used it in a project that required object selection (similar to RTS games unit selection). This can be used for collision tests if you want, but you should use the sphere tests first.   To use D3DXIntersect, you need two vectors; one for the starting position of the ray, and another for the direction of the ray.  You also need an ID3DXmesh to do the test against. Make sure you know if the object is in world space or model space. If its in model space, you will need to multiply your vectors by the inverse of the world matrix to get them into the same space. BOOL bHit = FALSE; FLOAT fDistance = 0.0f; FLOAT fRadius = 1.0f; D3DXVECTOR3 tvec3Origin; D3DXVECTOR3 tvec3Direction; //Intersects the ray with the mesh, sets bool with the result D3DXIntersect(m_pMesh, &tvec3Origin, &tvec3Direction, &bHit, NULL, NULL, NULL, &fDistance, NULL, NULL); if(bHit = TRUE) { //the ray has collided with the mesh if(fDistance < fRadius) { //do your collision logic } }   While this would work, I'm sure there is a much much better way of testing for collisions. The problem with using D3DXIntersect in this manner is that the ray is infinite, if an object is heading towards another, it will show up as a hit, hence the need for the second check. They way I have shown it above kind of wastes the accuracy of D3DXIntersect. A basic spherical collision test could have been performed at a fraction of the cost.    Never tried to implement rag doll physics, so not much help in that regard.