Jump to content
  • Advertisement

MTclip

Member
  • Content Count

    357
  • Joined

  • Last visited

Everything posted by MTclip

  1. MTclip

    a joint combinations problem

    well order is un important so i chose combination... I am trying to figure out the number of different ball combinations.. B has balls# 1 - 15 and 5 are in a combination I 16 - 30 & 5 in combo N 31 - 45 & 4 in combo G 46 - 60 & 5 in combo 0 60 - 75 & 5 in combo
  2. That was certainly interesting, but its not really what im looking for... at least I dont want to do that to solve this issue ;p thanks anyhow
  3. MTclip

    Tiny C++ Template Question

    You are taking a ref of a std::string so you can not assign a value to a ref that not there... this should solve it template <class T> T Foo(const string & string("12345") ){
  4. it does return size_t perhaps a better solution would be int size = (uint)vec.size(); for(int i = 0; i < size; i++) avoids cast & function call assumeing of course you are not changing the size of the vector in the loop
  5. Yeah that pretty much what I thought... Thanks
  6. MTclip

    Advice on my school..

    You can never judge a book by a cover... same goes for a degree program ;P ...also dont leave it upto someone else to tell/teach you what you need to know)...( by that i mean dont leave it up to any school/teachers to get you all the knowledge and info needed ). Take some initiative and find out( like you are ) -good luck
  7. MTclip

    D3DX Meshes

    lets not forget that ID3DXMesh is a COM object so you would not be able to call a constructor for your derived class... <hope im not wrong here> ;P I would just use CMesh as an adaptor type class.. make functions to reference the the parts of the ID3DXMesh you may need... as for the getting the vertex data.. have a vector or vector3 to hold your position vertices, or what ever else you need good luck
  8. MTclip

    What does this mean? class stuff

    Critter( int hunger = 0 ) that assigns a default value to the parameter... that way you can send a value in or just leave it blank and the value will be 0 Critter( 5 ) Critter() Critter::Critter( int hunger ): m_Hunger( hunger ) google initaliztion list It calls the members constructor basically its more efficient than Critter(int hunger ) { m_Hunger = hunger; } hope that helps
  9. MTclip

    D3D x mesh problem

    There are couple things that could be going on. First of all the D3DX mesh loading functions dont require you to supply an FVF so this makes me think that (a). you are loading the mesh yourself, or (b). you are trying to convert a loaded mesh to a specific FVF. Im not really sure what you are doing.. if you want to post your loading code I can better help you.
  10. MTclip

    D3D x mesh problem

    try turning of lighting pD3dDevice->SetRenderState( D3DRS_LIGHTING, FALSE ); but also if you do not supply diffuse colors they will be black
  11. MTclip

    ID3DXSprite trouble

    Quote: error LNK2001: unresolved external symbol "void __cdecl render(void)" (?render@@YAXXZ) that means it cant find "your" render function... make sure your function declaration and implementation have the same name.. your function was called render.. but I posted it as Render..
  12. MTclip

    ID3DXSprite trouble

    ... a couple things here... you are calling render once per frame. so your code also creates a texture & creates a sprite object every frame.. thats not good.. you should have a load function that gets called once at the begining of the program.. in the load function you load a texture and create the sprite. then rearage your render function like this void Render(void) { if( !pd3dDevice ) return; if( FAILED (pd3dDevice->BeginScene() )) return; // start sprite rendering pFront->Begin( D3DXSPRITE_ALPHABLEND ); pFront->Draw(pFrontTex, NULL, NULL, NULL, 0xFFFFFFFF); // end sprite rendering pFront->End(); pd3dDevice->EndScene(); pd3dDevice->Present( NULL, NULL, NULL, NULL ) }
  13. LPD3DXSPRITE::Begin() & ::End() must be in between IDirect3DDevice9::BecginScene() & EndScene()... // set the render target g_pD3DDevice->SetRenderTarget(0, g_pTextureSurface); // clear the target to a particular colour g_pD3DDevice->Clear(0, 0, D3DCLEAR_TARGET, STARTNODECOLOUR, 1.0f, 0 ); // render the text out to the object g_pD3DDevice->BeginScene(); renderTextureText(nodeToUpdate); // renderTextureText section -- g_pD3DXTextureSprite->Begin(D3DXSPRITE_ALPHABLEND); // render my text using a few of these calls g_pD3DXTextureFont->DrawTextA(g_pD3DXTextureSprite, pTextTotal, -1, &rect, DT_LEFT, D3DCOLOR_XRGB(200, 200, 200)); g_pD3DXTextureSprite->End(); // move this down here g_pD3DDevice->EndScene();
  14. You really want to avoid the sqrt.. but you seem to know that.. lookup SIMD .. //here is a faster absolute value _inline static float FastAbs(float f) { int i=((*(int*)&f)&0x7fffffff); return (*(float*)&i); } divides are a little slower so your normalize should get the inverse of length and multiply float iLenght = 1.0f / length; x *= iLenght; y *= iLenght; z *= iLenght; other functions you could add.. Length // return the magnitude of a vector LenghtSquared // return mag squared Min // returns the minimun xyz of two vectors Max // same but maximum Reflect // reflect the vector from a givin normal Project // project the vector from a given axis .. those are some of the things I find helpful
  15. Frustum Culling ... basically you find the area that it viewable through the camera and test to see if a vertex, or better yet some sort of bounds ( sphere, box... ) for a bunch of vertices is in side the view frustum.... if it is you render it...
  16. MTclip

    OBB transformation

    lets see.. I have the OBB to do collision detection amugst objects in the scene each Mesh gets an OBB generated at load time ( the mesh is assumed to be oriented in such a way that axisX = (1,0,0) axisY = (0,1,0) axisZ = (0,0,1) each object has a mesh pointer. an OBB, and a movement controller. The OBB is first copyied from the Mesh, and transformed based on the worldMatrix of the controller each frame i have working collision following this... how ever i am only getting the extracting the position world matrix... void SFOBB::Transform ( SFMatrix & mat ) { // get position m_center.X() = inv.Get(3,0); m_center.Y() = inv.Get(3,1); m_center.Z() = inv.Get(3,2); // still need extents // still need orientation } I can easily send in the separte transform matricies.. pos, rot, scale... but is this the way OBBs are used?
  17. MTclip

    OBB transformation

    Quote:Original post by jyk First of all I should say that although I think this is the best way to approach this problem, I'm not sure; I've never had occasion to re-scale or otherwise transform an OBB. if you dont transform the OBB then how do you update its position, and orientation with the object it evelopes? Am I misusing it?
  18. MTclip

    OBB transformation

    I'm a little mixed up here.. how do i get the orientation from the matrix.. I keep getting incorrect results? is it not axisX = _11, _12, _13 axisY = _21, _22, _23 axisZ = _31, _32, _33 thanks
  19. MTclip

    Collision Detection

    try this one D3DXIsAnythingTouching() no not really.. The best you get is D3DXIntersect() D3DXIntersectSubset() D3DXIntersectTri()
  20. something like this for int i = 0, j = 0; i < list1.size; i++, j++ if j >= list2.size j = list2.size list1 + list2[j]
  21. MTclip

    ID3DXFont problem

    I only use 1 sprite
  22. MTclip

    sin & cos.... any direction

    thanks guys... I figured my post may have been a little confusing... from my snippet.. only the emitter is moving from its origin to the target ( the particles are stationary ) and the spawn position is found based on the emitter position.. Quote: randomAngle = randomNumberBetween( 0, 2*PI ); randomRadius = randomNumberBetween( 0, radiusOfDisk ); particle.currentPos = EmitterPos; particle.currentPos.y += randomRadius * cos( randomAngle ); particle.currentPos.z += randomRadius * sin( randomAngle ); particle.velocity.x = aConstantOrWhatever; particle.velocity.y = particle.speed * cos( randomAngle ); particle.velocity.z = particle.speed * sin( randomAngle ); this would cause a random postion based off the sin / cos wave.. I want it to flow along the sin wave.. I am looking to make it so that the same "spiral" effect occurs no matter the direction the emitter is going... staaf: I would like it to rotate around any axis is that more clear? Thanks
  23. MTclip

    Rotating a sprite?

    Here is a nice function for you bool Blit(LPD3DXSPRITE pSprite, LPDIRECT3DTEXTURE9 pTexture, float DestX, float DestY, int SrcX, int SrcY, int Width, int Height, float XScale, float YScale, float rotation, D3DCOLOR Color) { // make sure a valid sprite was passed if( pSprite == NULL ) return false; // make sure a valid texture was passed if( m_Texture == NULL ) return false; // create the rect that will copy from the texture RECT Rect; Rect.left = SrcX; Rect.top = SrcY; Rect.right = Rect.left + Width; Rect.bottom = Rect.top + Height; // create the transformation D3DXMATRIX mat; D3DXMatrixTransformation2D( &mat, NULL, 0.0f, &D3DXVECTOR2( XScale, YScale ), NULL, rotation, NULL ); pSprite->SetTransform(&mat); // draw it if(FAILED(pSprite->Draw(m_Texture, &Rect ,NULL ,&D3DXVECTOR3( DestX, DestY, 0.0f ),Color))) return false; return true; }
  24. thanks for the replies.. Moe.. I confirm.. the system now does mesh, pointsprites, or quads.. the number are the FPS i was getting from rendering 500 particles point sprite runs the fastest.. 200 quads ( uses IB & VB to set and draw each vertex ) ... 170 Mesh.. 150 here is the interesting thing.. If back the camera up as far as it can go with but still keeping the particles in front of the far clipping plane.. the FPS goes up to 500 - 600.. so fillrate is the issue here... oh and a blank screen gets ~650
  • 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!