sambsp

Members
  • Content count

    39
  • Joined

  • Last visited

Community Reputation

122 Neutral

About sambsp

  • Rank
    Member
  1. if there are some topics or articles, just tell me, thanks.
  2. Hi experts, I found my transparent (color key, not alpha blending) blit was too slow since I need to compare each word (since I was writting the 16 bit version) one by one. Is there any optimization article about this? Really appericiated if you can tell me how to tackle such a problem on ARM7 platform. But any related information will be welcomed!
  3. Knowing 2 vectors (velocity, not normalized), then how can I get the combined vector of them?
  4. How to let ball go thru curve path?

    As I can think, 1. At the time ball just be released, it will get a velocity whose direction is same as the resulant force; 2. Then the ball will go thru that direction; 3. When ball moves, the friction will come and its direction will be the reverse of Velocity; 4. So, when ball moves (neglect air force), its resulant force is on the same line with its velocity, that won't let the ball run thru a curve path (as I know, object runs curve motion because the resulant force hasn't the same direction as object's velocity). That's what I thought about such a problem, what was ignored by me?
  5. How to let ball go thru curve path?

    Dear Squirm, then what's the details (sorry I cannot conclude the formula from what you said, :( )
  6. How to let ball go thru curve path?

    Ummm~~~, I think it's ten-pin-bowling. But what I care is the arithmetic (physics?) to push the ball. What need I add to such a game then my ball can roll thru a curve path to simulate the reality?
  7. I saw those guys developed bowling game can let the ball run thru a curve path (as I thought, give a force will make the game go thru the direction as as the force's, that should be a beeline), who can tell me what's the physics inside detailed (tutorials, links are also apperiated)?
  8. rabbi1337, thanks u very much. That's a valuable item I want to get, really appreciate.
  9. Dear all, thanks for your quick response. But after I read the replies, I still not know what to do clearly, please kindly show me more information as you can. Thanks.
  10. I'm much interesting in implementing of a kind of 2.5d (don't know if this name is exact) racing game, but cannot google any tutorial about the theory behind. Any one knows sth about it please give me a hand, thanks a million. For the game I talked about, you can refer to here: [url]http://www.gameloft.com/product.php?product=16&product_name=Speed+Devils[/url] or here [url]http://www.gameloft.com/product.php?product=52&product_name=Asphalt%3A+Urban+GT%99[/url]
  11. I'm much interesting in implementing of a kind of 2.5d (don't know if this name is exact) racing game, but cannot google any tutorial about the theory behind. Any one knows sth about it please give me a hand, thanks a million. For the game I talked about, you can refer to here: http://www.gameloft.com/product.php?product=16&product_name=Speed+Devils or here http://www.gameloft.com/product.php?product=52&product_name=Asphalt%3A+Urban+GT%99
  12. List of free libraries

    Hi all, seems there is bad link, where is the Newton Dynamic, I cannot access the site thru the link.
  13. I used 3DS Max6.0 to create a plane, and use a target camera to look at it. If this camera is in one side, in camera view, I can see this plane; But, when I move the camera to other side(also change the look at direction), I cannot see this plane, seems I can see thru this plane. My question, if I don't use 2-side property in "shader basic parameters" nor use light, how I can see the plane in both sides.
  14. As I find, till now when I attach the texture to my plane, both of 2 faces will get this texture, if I want to attach a different texture to a face, not by using one texture map. Can I solve that?
  15. In my program, I can see my red plane for alpha test if I don't let a ball in the program run (I comment the code to draw this ball), but if I let the program draw this ball, I will lose that red alpha plane. I attached the main code below (I don't know how to attach files). the ball drawing code is 'g_pBallMesh->DrawSubset (0);'. struct D3DVERTEX { D3DXVECTOR3 p; FLOAT tu, tv; static const DWORD FVF; }; const DWORD D3DVERTEX::FVF = D3DFVF_XYZ | D3DFVF_TEX1; VOID InitBall () { D3DXLoadMeshFromX ("ball.x", D3DXMESH_SYSTEMMEM, g_pd3dDevice, NULL, &g_pBallMeshBuffer, &g_pBallEffectInstance, &g_dwBallMaterials, &g_pBallMesh); posBall.x = 0.0; posBall.y = 0.0; posBall.z = 0.0; velBall.x = 5.0; velBall.y = 10.0; velBall.z = -8.0; } VOID InitRacket () { D3DVERTEX* v; mousePos.x = 320.0; mousePos.y = 240.0; // create the texture ( alpha channel used here ) D3DXCreateTextureFromFile (g_pd3dDevice, "racket.dds", &g_pRacketTextures); // create the vertex buffer g_pd3dDevice->CreateVertexBuffer (4 * sizeof (D3DVERTEX), D3DUSAGE_WRITEONLY, D3DVERTEX::FVF, D3DPOOL_MANAGED, &g_pRacketVertexBuf, NULL); g_pRacketVertexBuf->Lock (0, 0, (void**)&v, 0); v->p.x = -100.0; v->p.y = 100.0; v->p.z = 400.0; v->tu = 0.0; v->tv = 0.0; v += 1; v->p.x = -100.0; v->p.y = -100.0; v->p.z = 400.0; v->tu = 0.0; v->tv = 1.0; v += 1; v->p.x = 100.0; v->p.y = 100.0; v->p.z = 400.0; v->tu = 1.0; v->tv = 0.0; v += 1; v->p.x = 100.0; v->p.y = -100.0; v->p.z = 400.0; v->tu = 1.0; v->tv = 1.0; g_pRacketVertexBuf->Unlock (); } VOID InitWall () { D3DVERTEX* v; // load the texture D3DXCreateTextureFromFile (g_pd3dDevice, "wall.jpg", &g_pWallTextures); D3DXCreateTextureFromFile (g_pd3dDevice, "floor.jpg", &g_pFloorTextures); D3DXCreateTextureFromFile (g_pd3dDevice, "ball.jpg", &g_pBallTextures); // create the vertex buffer g_pd3dDevice->CreateVertexBuffer (20 * sizeof (D3DVERTEX), D3DUSAGE_WRITEONLY, D3DVERTEX::FVF, D3DPOOL_MANAGED, &g_pVertextBuf, NULL); g_pVertextBuf->Lock (0, 0, (void**)&v, 0); v->p.x = -300.0; v->p.y = 300.0; v->p.z = -300.0; v->tu = 0.0; v->tv = 0.0; v += 1; v->p.x = -300.0; v->p.y = -300.0; v->p.z = -300.0; v->tu = 0.0; v->tv = 1.0; v += 1; v->p.x = 300.0; v->p.y = 300.0; v->p.z = -300.0; v->tu = 1.0; v->tv = 0.0; v += 1; v->p.x = 300.0; v->p.y = -300.0; v->p.z = -300.0; v->tu = 1.0; v->tv = 1.0; // east wall v += 1; v->p.x = -300.0; v->p.y = 300.0; v->p.z = 300.0; v->tu = 0.0; v->tv = 0.0; v += 1; v->p.x = -300.0; v->p.y = -300.0; v->p.z = 300.0; v->tu = 0.0; v->tv = 1.0; v += 1; v->p.x = -300.0; v->p.y = 300.0; v->p.z = -300.0; v->tu = 1.0; v->tv = 0.0; v += 1; v->p.x = -300.0; v->p.y = -300.0; v->p.z = -300.0; v->tu = 0.0; v->tv = 1.0; // west wall v += 1; v->p.x = 300.0; v->p.y = 300.0; v->p.z = -300.0; v->tu = 0.0; v->tv = 0.0; v += 1; v->p.x = 300.0; v->p.y = -300.0; v->p.z = -300.0; v->tu = 0.0; v->tv = 1.0; v += 1; v->p.x = 300.0; v->p.y = 300.0; v->p.z = 300.0; v->tu = 1.0; v->tv = 0.0; v += 1; v->p.x = 300.0; v->p.y = -300.0; v->p.z = 300.0; v->tu = 0.0; v->tv = 1.0; // ceiling v += 1; v->p.x = -300.0; v->p.y = 300.0; v->p.z = -300.0; v->tu = 0.0; v->tv = 0.0; v += 1; v->p.x = -300.0; v->p.y = 300.0; v->p.z = 300.0; v->tu = 0.0; v->tv = 1.0; v += 1; v->p.x = 300.0; v->p.y = 300.0; v->p.z = -300.0; v->tu = 1.0; v->tv = 0.0; v += 1; v->p.x = 300.0; v->p.y = 300.0; v->p.z = 300.0; v->tu = 1.0; v->tv = 1.0; // floor v += 1; v->p.x = -300.0; v->p.y = -300.0; v->p.z = -300.0; v->tu = 0.0; v->tv = 0.0; v += 1; v->p.x = -300.0; v->p.y = -300.0; v->p.z = 300.0; v->tu = 0.0; v->tv = 1.0; v += 1; v->p.x = 300.0; v->p.y = -300.0; v->p.z = -300.0; v->tu = 1.0; v->tv = 0.0; v += 1; v->p.x = 300.0; v->p.y = -300.0; v->p.z = 300.0; v->tu = 1.0; v->tv = 1.0; g_pVertextBuf->Unlock(); eastPlane.normal.x = 1.0; eastPlane.normal.y = 0.0; eastPlane.normal.z = 0.0; eastPlane.position.x = -300.0; eastPlane.position.y = 0.0; eastPlane.position.z = 0.0; westPlane.normal.x = -1.0; westPlane.normal.y = 0.0; westPlane.normal.z = 0.0; westPlane.position.x = 300.0; westPlane.position.y = 0.0; westPlane.position.z = 0.0; southPlane.normal.x = 0.0; southPlane.normal.y = 0.0; southPlane.normal.z = 1.0; southPlane.position.x = 0.0; southPlane.position.y = 0.0; southPlane.position.z = -300.0; northPlane.normal.x = 0.0; northPlane.normal.y = 0.0; northPlane.normal.z = -1.0; northPlane.position.x = 0.0; northPlane.position.y = 0.0; northPlane.position.z = 300.0; ceilingPlane.normal.x = 0.0; ceilingPlane.normal.y = -1.0; ceilingPlane.normal.z = 0.0; ceilingPlane.position.x = 0.0; ceilingPlane.position.y = 300.0; ceilingPlane.position.z = 0.0; floorPlane.normal.x = 0.0; floorPlane.normal.y = 1.0; floorPlane.normal.z = 0.0; floorPlane.position.x = 0.0; floorPlane.position.y = -300.0; floorPlane.position.z = 0.0; } VOID MoveCamera() { D3DXMatrixLookAtRH( &g_hMatView, &D3DXVECTOR3( 0.0, 0.0, 1000.0), &D3DXVECTOR3( 0.0, 0.0, 0.0 ), &D3DXVECTOR3( 0.0f, 1.0f, 0.0f ) ); g_pd3dDevice->SetTransform( D3DTS_VIEW, &g_hMatView ); D3DXMatrixPerspectiveFovRH( &g_hMatProj, D3DX_PI/2, 480.0/640.0f, 400.0f, -400.0f ); g_pd3dDevice->SetTransform( D3DTS_PROJECTION, &g_hMatProj ); } VOID Render() { D3DXMATRIX matNow; if (NULL == g_pd3dDevice) return; g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0,0,0), 1.0f, 0 ); // we'll render the scene now g_pd3dDevice->BeginScene(); MoveCamera (); // vertex buffer g_pd3dDevice->SetStreamSource (0, g_pVertextBuf, 0, sizeof (D3DVERTEX)); g_pd3dDevice->SetFVF (D3DVERTEX::FVF); // wall g_pd3dDevice->SetTexture( 0, g_pWallTextures ); // matrix for the house D3DXMatrixIdentity (&matNow); g_pd3dDevice->SetTransform (D3DTS_WORLDMATRIX(0), &matNow); g_pd3dDevice->DrawPrimitive (D3DPT_TRIANGLESTRIP, 0, 2); g_pd3dDevice->DrawPrimitive (D3DPT_TRIANGLESTRIP, 4, 2); g_pd3dDevice->DrawPrimitive (D3DPT_TRIANGLESTRIP, 8, 2); // ceiling g_pd3dDevice->DrawPrimitive (D3DPT_TRIANGLESTRIP, 12, 2); // floor g_pd3dDevice->SetTexture( 0, g_pFloorTextures ); g_pd3dDevice->DrawPrimitive (D3DPT_TRIANGLESTRIP, 16, 2); // ball g_pd3dDevice->SetTexture( 0, g_pBallTextures ); D3DXMatrixTranslation (&matNow, posBall.x, posBall.y, posBall.z); g_pd3dDevice->SetTransform (D3DTS_WORLDMATRIX(0), &matNow); g_pBallMesh->DrawSubset (0); // racket g_pd3dDevice->SetRenderState (D3DRS_ALPHABLENDENABLE, TRUE); g_pd3dDevice->SetRenderState (D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); g_pd3dDevice->SetRenderState (D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); // use alpha channel in texture for alpha g_pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); g_pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); D3DXMatrixIdentity (&matNow); g_pd3dDevice->SetTransform (D3DTS_WORLDMATRIX(0), &matNow); g_pd3dDevice->SetTexture (0, g_pRacketTextures); g_pd3dDevice->SetStreamSource (0, g_pRacketVertexBuf, 0, sizeof (D3DVERTEX)); g_pd3dDevice->DrawPrimitive (D3DPT_TRIANGLESTRIP, 0, 2); g_pd3dDevice->SetRenderState (D3DRS_ALPHABLENDENABLE, FALSE); g_pd3dDevice->EndScene(); // end of the scene rendering g_pd3dDevice->Present( NULL, NULL, NULL, NULL ); } [Edited by - Coder on August 26, 2004 12:39:52 PM]