Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

126 Neutral

About dae_coderonin

  • Rank
  1. dae_coderonin

    PhysX - strange behaviour

    Hi there! We're using the NVidia PhysX SDK for collision detection. Our level is represented by a set of cooked triangle meshes. Now, according to the visual debugger, everything is cooked correctly. Apparentaly, the world space center of mass and center of mass values aren't set for our cooked stuff - I haven't been worrying about that, though, as I thought it was just a PhysX/TriangleMesh specific thing. Anyhow, after 2 frames, NxScene::Simulate() does very strange things and just completely destroys the level, setting the positions to rubbish values. Interrestingly, the same code did already work (if buggy) for another level as well as our character controllers and shapes. Anyone experienced the like? Any help is highly appreciated as we're getting tight on time... The corresponding event dump can be found at:
  2. dae_coderonin

    PhysX CharacterController + CCD

    Hi there. I'm working on a 3rd person shooter using the PhysX SDK. The level is represented by a cooked triangle mesh. Controllable models (that is, human players and ai agents) are represented by CharacterController objects. According to the remote debugger, the controllers seem to be properly bounded. Still, at some points the controller seems to be "floating" while in other cases it just "sinks into" the level-mesh. Has anyone of you experienced the like? Could it be related to some CCD issue? Best regards, Lukas [Edited by - dae_coderonin on April 18, 2010 7:01:54 AM]
  3. Hi Folks! In order to get some training, I've recently developed some 2D arcade games. Basically, it's just remakes of old arcade classics. So far I've implemented: * Minesweeper * Invaders * Pong! * Snake You can find all of those games at, under "downloads". Granted, all of the games mentioned above (with the exception of Minesweeper, that is) suffer from severe lacks in terms of graphics quality, but then I'm only a programmer, not a graphician. All the gameplay is implemented, ready with menues and highscore-tables and all. However, there's one point that still won't work: Surface restoration. When I switch back to Windows with alt-tab and try to activate the game again, the window just won't show. I've read a lot about releasing and resetting devices and some magical "RestoreAllSurfaces" function I've not quite been able to find. Does anyone have an idea on how to get my game back to screen after use of alt-tab? I'm using DirectX 9.0, and LPD3DXSPRITEs to directly display my stuff... Any help would be appreciated, best regards, Lukas
  4. dae_coderonin

    C++/STL - Slow? SOLVED

    Quote:Original post by MadKeithV Quote:Original post by dae_coderonin My question here is this: Are stl vectors really that slow, is it just the Debug setting (I'm working with MS VS2003) You should NEVER base ANY performance judgements on the debug build of a project. There are many, many things that could be going on behind the scenes in a debug build that slow things down, such as checked allocations and iterations, additional logging, and also some optimizations that more advanced classes may rely on will not happen in debug. I have some code around that takes a minute to complete in Release mode, and four hours in Debug. Try it in Release mode first and if you still have a problem it's worth looking into. Alright MadKeithV, thank you. Just tested in Release mode, and it runs kinda smooth. Can still use some optimization, but I'll do that when all functionality is implemented. No point in making my code unreadable at that point. Thank you, guys!
  5. dae_coderonin

    C++/STL - Slow? SOLVED

    Thank you, dalleboy, I'll do that. Never used a profiler before, though. Where can I find a good/easy to use one?
  6. Hi Guys! Currently I'm working on a rendering-engine in C++ with OpenGL. So far, everything goes well, thanks to some help over in the "Graphics Programming" board ;). However, I've now replaced some of my model-code for better readability. Specifically, I've replaced static float * and int * arrays that held my vertexbuffer and an indexed geometry in favor of stl::vector template objects. Now, my code is pretty much FUBAR. It's speed has decreased by a factor of approximately 80, according to frame counts. My question here is this: Are stl vectors really that slow, is it just the Debug setting (I'm working with MS VS2003) or is it neither and have I messed up somewhere else, bigtime? I can post code as well, but I think that's a pretty general question... Any help is appreciated, best regards, Lukas [Edited by - dae_coderonin on October 31, 2008 5:53:49 AM]
  7. dae_coderonin

    Rotate a texture

    Now maybe that's a no-brainer on my side, but in your code snippet you don't set your rotation matrix... ? Do you do it in your app?
  8. dae_coderonin

    Skeletal animation: references

    Thank you, Paool! I'll check on that ASAP!
  9. Hi there! Do you know good books, tutorials or other references on the topics "skeletal animation" and "skinning"? I need to work through these things for my current 3d project. I've already got a working scenegraph, camera control, basic rendering and some collision detection, now I need to get down and dirty with animations... any pointers to good reference material is appreciated. best regards, Lukas
  10. Hi there! I've written a couple of small games (Pong, Spaceinvaders, etc.) using the DirectX 9.0 SDK. Now they're done and running but I've left one big issue unadressed: Surface restoration. Whenever I set the focus to any other app by pressing ALT+TAB, my game is done. I mean, it's running and all but I can't display the window and the graphics anymore. Have you experienced similar problems? If so, how did you solve them? best regards, Lukas
  11. dae_coderonin

    Matrix Stack

    You're absolutely right on that one. However, I didn't say "If you want to be truly API/OS/whatever independant", I said "if you really want to be independant from any external stuff", which sometimes is needed, e.g. in university projects (at least, at our university, we often have to do that kind of stuff, for a variety of reasons). Just pointing out a different (if slower, less efficient, etc.) possiblilty. best regards, Lukas
  12. dae_coderonin

    Isometric without the diamond tiles

    Why would you want to do that? Like, where's the point in not using diamond-shape tiles? Well, nevermind, your choice. Basically, if you're doing diamond-shaped stuff, you just rotate your graphics (like, usually 45 degree). So, in order to do those graphics I'd suggest you take a couple of diamond-shaped graphics, rotate them back (re-align them with a rectangular grid) and see how they look. Just maybe, you need not change so much. I'm no graphical artist myself, but I've once implemented a hexagonal-isometric engine, and the graphics made by our artist looked just fine... Hope that helps, best regards, Lukas
  13. dae_coderonin

    Matrix Stack

    Right. Basically, not much to add on this one (obviously, there's not much to add to jyk's replies now, is there?), however, if you really want to be independant from any external stuff, you could just use a single linked list and do memory management yourself. best regards, Lukas
  14. dae_coderonin

    Calculating a look-at vector

    RESOLVED. Thank you guys for your help. I've now finally solved my problems. Now, I can calculate my look-at vector and freely move in my scene. Now for texturing! ;) Once again, thank you all for your helpful replies, best regards, Lukas
  15. dae_coderonin

    Calculating a look-at vector

    Ok, that's more literate, you're right. Changed that. It's now mfv_lookDirection. Unfortunately, my code still doesn't produce the desired results. I've now switched the order of my camera-to-world transformations. Basically, the idea (as I got it to this point) is to apply a transformation matrix to the scene, then point down the negative z-axis and apply the inverse viewMatrix to rotate that direction back into world space. Hope I got that right to that point. Now basically, since I negate the angles and translations in my original viewmatrix, the inverse should be the positive angles and translation, in the opposite order. (Again, I hope that's correct.). This is what my scene calculations looks like: int Scene::displayScene(void) { DWORD start = GetTickCount(); float cameraPos[3] = {0}; float cameraRot[3] = {0}; float cameraLookAt[3] = {0}; float cameraUp[3] = {0}; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); glLoadIdentity(); cameraList *h = ms_cameraList; for (int i = 0; i < mi_cameraIndex; i++) h = h->next; h->camera->queryCameraPosition(cameraPos); h->camera->queryRotation(cameraRot); h->camera->queryLookDirection(cameraLookAt); h->camera->queryUpVector(cameraUp); // RECALCULATE SCENE ROTATION AND TRANSLATION h->camera->recalculate(); // DISPLAY MODELS AND APPLY ALL TRANFORMATIONS TO EACH OF THEM displayModels(); // FURTHER DEBUG CODE, DRAW MODEL COORDINATE SYSTEM h->camera->drawCoordinateSystem(); glPopMatrix(); glutSwapBuffers(); //for (DWORD end = GetTickCount(); (end - start) < 300; end = GetTickCount()); return CONST_SUCCESS; } void Camera::recalculate(void) { // DRAW WORLD COORDINATE SYSTEM IN FRONT OF CAMERA glPushMatrix(); glLoadIdentity(); glTranslatef(0.0f,0.0f,-3.5f); drawCoordinateSystem(); glPopMatrix(); //REPLACE GLULOOKAT: glRotatef(-mfv_rotation[0],1,0,0); glRotatef(-mfv_rotation[1],0,1,0); glRotatef(-mfv_rotation[2],0,0,1); glTranslatef(-mfv_cameraPosition[0], -mfv_cameraPosition[1], -mfv_cameraPosition[2]); //DO CAMERA-TO-WORLD TRANSFORMATIONS MANUALLY float transformationMatrix[4][4], viewMatrix[4][4]; float newpos[3]; // SET NEW NIEWMATRIX TO IDENTITY mC_UtilityBox->setIdentity(viewMatrix); // APPLY VIEW-MATRIX TRANSFORMATIONS (INVERSE) // ROTATE VIEWMATRIX AROUND Z-AXIS mC_UtilityBox->setRotateZ(transformationMatrix, mfv_rotation[2]); mC_UtilityBox->multMatrix(transformationMatrix, viewMatrix); // ROTATE VIEWMATRIX AROUND Y-AXIS mC_UtilityBox->setRotateY(transformationMatrix, mfv_rotation[1]); mC_UtilityBox->multMatrix(transformationMatrix, viewMatrix); // ROTATE VIEWMATRIX AROUND X-AXIS mC_UtilityBox->setRotateX(transformationMatrix, mfv_rotation[0]); mC_UtilityBox->multMatrix(transformationMatrix, viewMatrix); // TRANSLATE VIEWMATRIX BACK TO CAMERA mC_UtilityBox->setTranslate(transformationMatrix, mfv_cameraPosition[0], mfv_cameraPosition[1], mfv_cameraPosition[2]); mC_UtilityBox->multMatrix(transformationMatrix, viewMatrix); // TRANSPOSE VIEWMATRIX //mC_UtilityBox->transposeMatrix(viewMatrix); // POINT NEW LOOK AT DOWN NEGATIVE Z-AXIS mfv_lookDir[0] = 0; mfv_lookDir[1] = 0; mfv_lookDir[2] = -1; mfv_lookDir[3] = 0; // TRANSFORM NEW LOOK-AT VECTOR mC_UtilityBox->transformVector(mfv_lookDir,viewMatrix,newpos); // NORMALIZE NEW LOOK-AT VECTOR //mC_UtilityBox->normalizeVector(newpos); // SET NEW LOOK-AT VECOTR mfv_lookDir[0] = newpos[0]; mfv_lookDir[1] = newpos[1]; mfv_lookDir[2] = newpos[2]; mfv_lookDir[3] = newpos[3]; // DEBUG CODE glPushMatrix(); glColor3f(1.0f,0.0f,0.0f); glTranslatef(mfv_cameraPosition[0] + mfv_lookDir[0], mfv_cameraPosition[1] + mfv_lookDir[1], mfv_cameraPosition[2] + mfv_lookDir[2]); GLUquadricObj *glu_obj = gluNewQuadric(); gluSphere(glu_obj, 1, 100, 100); glPopMatrix(); } So I draw a gluSphere for 1 unit in the direction of my lookVector to see if it's transformed correctly. It's not. As a matter of fact, it produces the same results as when I first rotate back xyz instead of zyx. Any ideas?
  • 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!