Jump to content
  • Advertisement

Dan Danger

  • Content Count

  • Joined

  • Last visited

Community Reputation

323 Neutral

About Dan Danger

  • Rank

Personal Information

  • Interests
  1. Dan Danger

    SAT problems (3D)

    The obbsetup code should initialise the min values to +infinity and the max values to -infinity. Otherwise your obb will always include the position {0,0} void OBB::obbsetup(std::vector<glm::vec3> vetrices) {     glm::vec3 tempmin = glm::vec3(+INFINITY,+INFINITY,+INFINITY);     glm::vec3 tempmax = glm::vec3(-INFINITY,-INFINITY,-INFINITY); ..... }
  2. Dan Danger

    Leading the Target

    A great article describing a very useful function with code that can actually be used.   I much prefer to see code rather than mathematical equations. I am a programmer and not a mathematician so I appreciate the problem being solved in simple code.   If I had the equations, and I could understand them, I would not need a tutorial like this in the first place ^_^
  3. Dan Danger

    checking if resource has changed

    In our system (c++ engine) we have various resources zTexture, zShader, zSound, etc....   Each resouce inherits from zResource. zResource contains the file name the resource was loaded from and the modified date of the file.   To check if a resource has changed on disk, we simply compare the modified date of the file with the one we have stored. If it is not the same then the resource has changed and we reload it.   It should be noted that a zResource does not actually contain the data of the resource. That is handled by a different proxy class which the zResource has a reference to.   eg.   zTexture contains a pointer to a zHardwareTexture (abstract base class) There is an openGL implementation of this called zHardwareTexture_OGL. This class contains all the api specific texture data. So when a change in a texture is detected, only the zHardwareTexture reference is changed, not the zTexture.   This means we can pass around zTexture pointers without worrying about if  actual texture data has changed.     To detect when a file has changed, on the PC platform we use the windows api funciton FindFirstChangeNotification. This detects changes on the filesystem without having to scan the directories manually.   Hope this helps.    
  4. Dan Danger

    Constructor gotcha's?

    One thing that tripped me up in the early days of learning c++ was calling virtual functions in constructors. Do not call virtual functions in constructors, as they will not work properly!   ^_^
  5. Dan Danger

    PID Control of Physics Bodies

    A great article that explains clearly and precisely what a PID controller does. I have tried to create PID controllers before and always never quite got them to work because I simply did not understand the maths. Now with your code I can control my physical bodies much more accurately and predictably. Thanks ^_^
  6. Dan Danger

    Preview a mesh like blender solid

    Dont set your ambient light to pure white, that is why your model is being displayed as pure white with lighting disabled.
  7. What you could do is: Assume this is 2d for a moment. Calculate how much you want the players block to move ( call it dx,dy) Move the player block along its x axis (dx) Check for collisions and push player block back along the x axis if colliding Move player block along its y axis (dy) Check for collisions and push player block back along the y axis if colliding I used this very same system for this game: http://dandanger.blogspot.com/2009/04/keith-goes-painting-is-bouncey-squishy.html ... and it worked fine for most cases ^_^
  8. Dan Danger

    OpenGL a roatated glScissor

    There is no best solution, it really depends on what you are trying to do. If you have a lot of geometry to render to your rectangle, then an of screen buffer might be best. Stencil buffer may not be best as iphone opengles1.1 doesnt not support them. I just finnished a clipping system that clips 2d sprites and 2d polygons to a concave area before it sends it to opengl. This is for our in house animation system, and manually clipping the elements seemed the best solution for us.
  • 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!