Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

166 Neutral

About Graham

  • Rank
  1. Graham

    Think your smart, I thought I was...

    I think that it you take into account gravity pulling the chain away from the bottom of the cylinder as it turns it should be 170.2. If the chain and cylinder were magnetized then it would wrap tightly around it and you get 137.
  2. Is it possible you are using some gdi function that is only in WinXP/2k. You could try and check all your system calls and see if they fail anywhere. Maybe update video card drivers.
  3. I believe its calling the deconstructors after you do push-back because its resizing its array as you add more. The growth is almost exponential so it should eventually make plenty of space so it doesnt keep deconstructing the previous ones. You should be able to get around that by calling v.reserve(#) to enough space to hold a certain amount of elements.
  4. Graham

    Collision efficiency question

    Its just a guess, but I think the only differences would come from cache performance. I think in option A you would have more cache hits with the 5 enemies.
  5. Graham

    Heightmap Collision

    Once you know the triangle you are over, you use the dot product with the normal of the triangle to findout if you are below the triangle. If you are below the triangle, how do you find a point on the triangle that has your current x and z coordinates but a y coordinate directly on the triangle face? I think you solve the dot product equation for y...
  6. Graham

    Heightmap Collision

    Alright that makes sense thanks.
  7. Graham

    Heightmap Collision

    Im also working on something similar. I understand how to find the quad, but Im not sure how the perp-dot product is used to find the triangle. Can you how its done? Thanks.
  8. Graham

    View Frustrum Planes

    Using the inverse viewProj matrix did not help. I now have it working though, I since it was mirrored on all 3 axis, I just multipled the all the vectors by -1 and it works great. Thanks for the help.
  9. Graham

    View Frustrum Planes

    Thanks for the reply Armadon. I have computed the inverse of the ViewProjection matrix. I am wondering how would I multiply my D3DXVECTOR3 variable by D3DXMATRIX. D3DXVECTOR3 topLeftN; topLeftN = Intersect3Planes(m_planes[0], m_planes[2], m_planes[4]); D3DXMATRIX res; D3DXMATRIX view = Camera.GetViewMatrix(); D3DXMATRIX proj = Graphics.GetFOV(); D3DXMatrixMultiply(&res, &view, &proj); D3DXMatrixInverse(&res, NULL, &res); // need to do this multiplication. //topLeftN = res * topLeftN ;
  10. I am working on doing some view frustum culling and I wanted to be able to visualize the view frustum first. So in my terrain engine I have 2 cameras that I can switch between and I want to draw the view frustum for Camera1, then switch to camera2 so I can see how it clips the terrain. I beleive I have extracted the planes correctly, and found all 8 intersection points. The problem is that when I draw the view frustum is it always mirrored around the origin. Once I have the 8 intersection points do I need to use the view matrix to get them into world coordinates? Here is some code Im using to get the planes: void CTerrain::ExtractPlanes(void) { D3DXMATRIX res; D3DXMATRIX view = Camera.GetViewMatrix(); D3DXMATRIX proj = Graphics.GetFOV(); D3DXMatrixMultiply(&res, &view, &proj); // left m_planes[0].a = res._14 + res._11; m_planes[0].b = res._24 + res._21; m_planes[0].c = res._34 + res._31; m_planes[0].d = res._44 + res._41; // right m_planes[1].a = res._14 - res._11; m_planes[1].b = res._24 - res._21; m_planes[1].c = res._34 - res._31; m_planes[1].d = res._44 - res._41; // top m_planes[2].a = res._14 - res._12; m_planes[2].b = res._24 - res._22; m_planes[2].c = res._34 - res._32; m_planes[2].d = res._44 - res._42; // bottom m_planes[3].a = res._14 + res._12; m_planes[3].b = res._24 + res._22; m_planes[3].c = res._34 + res._32; m_planes[3].d = res._44 + res._42; // near m_planes[4].a = res._13; m_planes[4].b = res._23; m_planes[4].c = res._33; m_planes[4].d = res._43; // far m_planes[5].a = res._14 - res._13; m_planes[5].b = res._24 - res._23; m_planes[5].c = res._34 - res._33; m_planes[5].d = res._44 - res._43; for(int i=0; i < 6; i++) { D3DXPlaneNormalize(&m_planes, &m_planes); } return; } And getting the 8 intersection points D3DXVECTOR3 topLeftN, topRightN, botLeftN, botRightN, topLeftF, topRightF, botLeftF, botRightF; // Ends is N is on near plane, end in F is far plane. topLeftN = Intersect3Planes(m_planes[0], m_planes[2], m_planes[4]); topRightN = Intersect3Planes(m_planes[1], m_planes[2], m_planes[4]); botLeftN = Intersect3Planes(m_planes[0], m_planes[3], m_planes[4]); botRightN = Intersect3Planes(m_planes[1], m_planes[3], m_planes[4]); topLeftF = Intersect3Planes(m_planes[0], m_planes[2], m_planes[5]); topRightF = Intersect3Planes(m_planes[1], m_planes[2], m_planes[5]); botLeftF = Intersect3Planes(m_planes[0], m_planes[3], m_planes[5]); botRightF = Intersect3Planes(m_planes[1], m_planes[3], m_planes[5]); Thanks for any help on this. edit. Then for example the left plane would be drawn like this. Graphics.m_pd3dDevice->SetFVF(D3DFVF_VertexColor); VertexColor g_Vertices[] = { // left { topLeftN.x, topLeftN.y, topLeftN.z, 0xFFFF0000}, { botLeftN.x, botLeftN.y, botLeftN.z, 0xFFFF0000}, { topLeftF.x, topLeftF.y, topLeftF.z, 0xFFFF0000}, { botLeftF.x, botLeftF.y, botLeftF.z, 0xFFFF0000} } Graphics.m_pd3dDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, g_Vertices, sizeof(VertexColor));
  11. 5 fps is too low unless your have a card from 6 years ago. debug the application with the debug libraries and see what messages you get.
  12. Graham

    Texture splatting

    You will need to do multipass rendering to get it to work. First set up the base texture states and drawprimitive(), then set up the states for the alpha map and texture and drawprimitive() again. You can do it in one pass using a pixel shader.
  13. Graham

    Vertex Fog

    Does it work for linear fog. Try using linear fog with a distance of 50 for start and 150 for end.
  14. Graham

    Right Handed to Left Handed

    This article talks about switching between them.
  15. Graham


    In my system each control has a function pointer that is set in the contructor. When a control detects that it has been clicked, then it calls the function pointer. Graham.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!