• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About keethrus

  • Rank
  1. Just a quick question. If I want to have a large "polygon" 2d world, what's the general way to store points the world/entities. Do you have a big list of 64-bit doubles? Do you separate your world into grids, where each grid has a list of points? My main concern is my lack of knowledge with floating points. If I have two objects in my world that are close and therefore I need to do collision testing/reaction on them, it seems it would be more accurate if they were "smaller" versus "larger". Ie. 10.452 and 12.871 versus 10452.0 and 12871.0. Is this concern unfounded? Thanks, - Jeremiah
  2. I've posted a new version of my game physics library. You can view it in action on YouTube here: http://www.youtube.com/watch?v=XFUmXDMy3Vg Or download it from my website and play around with it yourself: http://inlovewithGod.com/physics.php It's a lot more stable and faster than my first version. Speed question: The demo has a rope bridge. If I pile up more than 30 squares on the bridge, my FPS drops below 30. I would think things can be made faster than that. Am I right? Or does 30 piled up squares on a rope bridge seem "too much"? I hope not. Right now I'm doing quick collision test exclusion by doing a radius check around each object. That sped things up a bit. I was thinking about breaking up my world into grid cells and using that as another quick exclusion test too. But in the demo all the things are piled up close, so that wouldn't really help much in this case. Does anybody have any pointers that I'm probably missing on how to get more speed out of my physics library? Thanks, - Jeremiah
  3. My physics engine demo

    Sirisian, I'm not sure I understood what you were saying. Could you elaborate or point to pages about the method you use for line-line intersection? What I'm doing is (1) accumulating all acceleration values for all points (2) calculating new velocities for all points based on new accelerations (3) "fix" velocities of points so they don't penetrate other lines. What do you do differently? _Sauce_, I've only had that come about when I've created multiple polygons overlapping. (pressing n really fast to create them at the same spot one right after another). The "collision" fixing code doesn't handle that much "collision". :-) Did you get that from doing what I said above, or did that come about from "normal" play? Thanks, - Jeremiah
  4. My physics engine demo

    I just put up a page demo'ing my physics engine. http://www.inlovewithGod.com/physics.php It uses fixed-point math because I want to be able to do play-backs and such and have more determinism than floating point. My game will be a top-down 2D game, so there won't be any "stacking" stability issues, but for the demo I do have gravity and it's surprisingly more stable than I thought I could get with springs and simple Euler-type integration. Some learned experiences: I was using 6-bits for the fraction-part, and no velocity "damping" (air drag?). And things were always jittery and bouncy. Changing to 8-bits helped a lot. I'm thinking because it made the "fit collision penetration" more accurate. Adding the velocity damping (even by the smallest amount I could, 1-bit in 8-bits of fraction, helped things stable down a whole lot. Since the "fit collision penetration" code needs fractions, and I only have 8-bits, that means it can fix penetration of a line by 1/256ths of it's length. So really long lines are out of the question. But for my game that's ok. If anybody is interested, I could explain more of what I did. Not sure if it would help anybody, but you never know. :-) Thanks, - Jeremiah
  5. Gear Face, Inc. has just released it's first developer library - for FREE! :: A free IP to Country system :: Link: http://GearFace.com/iptocountry.php Online Demo: http://GearFace.com/ip2cDemo.php With this free library your site can automatically determine the country of its visitors. Use it to deliver content based on the visitor's location, automatically choose the right content in the visitor's native language, or improve your website visitor logs. It can even keep your IP to Country database updated automatically. Update monthly, weekly, or even daily. It's completely up to you. And with the easy-going license our name will never show up on your site. It's free, easy, and only takes a minute to setup. Try it out today! Tell your friends about the free IP to Country system at GearFace.com. - Jeremiah GearFace.com Useful Developer Libraries, Tools, and Resources.
  6. I'm researching and learning openGL and so far the concepts and structure seems pretty understandable. I do have a question about placing objects in the world (rendering them translated and rotated) in regards to the matrices. To be efficient, do you reset the matrix after you draw each object? Do you push the matrix before you draw, do translating and rotating, and then pop the old one afterwards? I'm just a little confused about this. Like for example, if I'm making a 3D tank game, where there are 5 tanks, each tank being comprised of a main body, a rotating "head" on top, and a vertically raising/lowering turret that comes off the rotating "head". How do you deal with all the matrix stuff in drawing each tank, in each location, facing each direction, with each head facing another direction, and finally the turret being raised to a certain angle? - Jeremiah
  7. My program is receiving: C:\Progra~1\MyAppN~1\someFi~1.xyz (no quotes) and then it puts the exact string into fopen, which returns a failure. - Jeremiah
  8. I'm creating a file type association in the windows registry, and everything works fine besides one small part. When I put the "%1" in the registry, it is giving my application the "DOS style" short path and file name instead of the full path and file name. Example: "C:\Progra~1\MyAppN~1\someFi~1.xyz" instead of "C:\Program Files\MyAppName\SomeFileName.xyz" And therefore my app is not able to open it with fopen. I know I could use GetLongFileName( ) but it's not available in Windows 95. There's also an equivalent piece of code that uses FindFirstFile to get the long path/filename, but I'd rather fix the "%1" registry part. I've searched high and low for an answer and come up short! Anybody come into contact with this before and know what's going on? - Jeremiah
  9. OpenGL quick question

    When you're learning, sometimes just having one question clarified can really help you understand what's going on ... and getting this clarified has helped me get a much better understanding on OpenGL. :) Thanks for all the replies!!! - Jeremiah
  10. Kibble, I wasn't using WS_CLIPCHILDREN anywhere, so it wasn't that. Thanks for the suggestion. :) Quote:Original post by Xiachunyi Sorry, now I'm stumped on why that message did not work for. For the "refresh", you can force the window to redraw itself with the "InvalidateRect" function. *** Source Snippet Removed *** Hope that helps. Xiachunyi, It works like a charm now. That was exactly what I needed. :) - Jeremiah
  11. Im just starting to research OpenGL and how to use it, but I have a quick question. Do you really "create" the scene each frame? By that I mean, do you have to do all the glBegin, glAddWhatever, glEnd to put all your polygons on the screen each frame? It seems, in my obviously ignorant mind, that there could be a way to just store the world in memory, and then tell OpenGL where to put the camera and how to position it each frame. Anyway, I was just wondering if you always had to do the glBegins, glAdds, glEnds each frame. :) - Jeremiah
  12. Quote:Original post by MindWipe Quote:Original post by keethrus Quote:Original post by MindWipe I just find it odd how the exact same data gets bigger just by decompressing and recompressing it. That's where the PNG pre-filters come in. They go through the image making changes to make the image less random. They have the potential to take a horizontal gradient line and turn it into a horizontal line of one single color. And obviously a line of one single color can get compressed much easier than a line that is a gradient of ever increasing color values. That's why when you take the raw PNG image data and compress it it gets larger than the PNG version. PNG's pre-filters allow the compressor to do a better job. I love PNG, to me it's absolutely the best image file format out there. GIF, JPEG, etc can't even come close to PNG. It's pre-filters is just one part of many that makes PNG great. Anyway, just wanted to help clarify the question MindWipe had. :) - Jeremiah UGH! I KNOW HOW PNGS WORK! I know about the filters!!! But if I don't de-filter the PNG, I just decompress data data and recompress the data! (For those who know more it's the data in the IDAT chunk and if you decompress that data you'll got width * height * bpp + height amount of bytes, cause every scanline has one byte that specifies witch filter it uses from: none, add, up, average and paeth) /MindWIpe Ohhh .. . Sorry about that. I misunderstood you. :) Now that I know what you're talking about, that does sound really odd. - Jeremiah
  13. I appreciate the post Xiachunyi but I've tried using the WM_CTLCOLORBTN message with no luck. I received the message, tested to see if it came from one of the three radiobuttons (never got this to work, so i just responded to all WM_CTLCOLORBTN messages with the same brush), and returned a brush that was red. Nothing changed in the program at all. Now, the OWNERDRAW is working "technically", but you have to drag the window off screen and then back on for it to refresh itself and draw all three radio buttons in their correct state. If you don't and you just click around on the radio buttons, their images are not accurate (two will be drawn checked and one won't, etc). Any suggestions? - Jeremiah
  14. WM_CTLCOLOR didn't work. Absolutely nothing changed. I tried to just make the radio buttons OWNERDRAW, but I'm having problems here as well. When I click around on the radio buttons, they don't act as they should, and then finally they end up backwards (all are checked besides the one that is supposed to be checked, which is unchecked). However, If I drag the window off screen and then back on screen, everything is drawn as it should. I'm handling checking/unchecking the radio buttons myself. Any ideas what could be doing this? Or anyway to make sure everything is refreshed to make everything drawn correctly (because of dragging the window off and then back on the screen fixes everything). Any suggestions? - Jeremiah
  • Advertisement