kadaf

Members
  • Content count

    160
  • Joined

  • Last visited

Community Reputation

247 Neutral

About kadaf

  • Rank
    Member
  1. Triangle fans and such usually only work with convex shapes. In case of your 'L' it's no longer convex but concave. I don't know the details of Dark Forces and BUILD, but if they're like Doom as I imagine, they create a 2D BSP tree of the walls. The end leaves of this tree form convex polygons per definition. Wikipedia has a good article on how the original Doom engine works. Anyway, you don't necesarily need to do it the BSP way - the key is that you need to convert your concave floor shapes into multiple convex ones. BSP is just a very elegant way to do it.
  2. OpenGL GLSL Problem

    Are you sure your ATI card supports all the GLSL features you're using? Or maybe you've made a bug in your shader code which doesn't affect your nVidia card, but makes ATI's drivers fail. Why you don't get an error message I don't know... How about posting some minimal code examples that still produce the problem?
  3. Random Number Generation Issue

    It's because you for each cycle resets the random seed with srand() to the same value. Your loop is so fast that time() won't change before you've finished looping. Simply call srand() outside the loop instead. By the way, it's usually not a good idea to use rand()%SOMETHING, because that will return the low bits of your random number - and those are usually "less random" than the high bits. EDIT: somebody beat me to it :)
  4. lua

    I'm not sure I understand your questions correctly... Is your first question when you should call lua_register()? If so, the answer is that you should just do it at any point before you execute the Lua script. A good place would probably be when you've just created your Lua virtual machine. If your second question is how you run the script, you'd either want to load it unto the stack with luaL_loadfile() and then run it with lua_pcall(), or simply call luaL_dofile() on it to both load and run it.
  5. OpenGL Object Rotation

    You need to first translate the object, and then you can rotate it - i.e. basically move the object so the pivot point is located at the center. You can use glTranslatef(x,y,z) for that.
  6. SDL Mouse Usage

    Quote:If I have a hardware device(Nintendo's Wii Remote) that can control XORG's mouse with some additional drivers and a bluetooth adapter, can I use that to be the mouse for my game? Well, if it can control your normal mouse cursor, then it can also control the cursor in SDL. Check out: http://www.libsdl.org/cgi/docwiki.cgi/SDL_20Guide
  7. advanced 2D physics engine?

    I think I've ranted about just using plain ODE for 2D physics before, but I'll happily do it again :) To my experience, plain ODE works perfectly for 2D. Just keep all your Z-values zero, and everything just stays perfectly in the XY plane. Furthermore, only do rotations and torques around <0,0,1>. Voila. A very good 2D physics engine, no need for any modifications/extensions to ODE. This is the approach used by xmoto. The primary downside to this is the heavier computational requirements: a strict 2D physics approach would lower these quite a lot.
  8. Personally I'd just use libcurl. Maybe implementing a HTTP GET directly with sockets is simple, but using libcurl you're absolutely sure it works. No wasted time on debugging. The library is released under a MIT license (not as restrictive as GPL/LGPL), so you can just copy-paste the code directly into your project. Also, with libcurl you get quite advanced stuff like proxy-support for free - and HTTPS if you can live with an extra dependency.
  9. I suppose that you only check whether you're connected to a network - i.e. if a cable is plugged into your network adapter and there's some kind of network equipment on the other end. Basically it's hard for a computer to know how large a network it's connected to. I think the only solution is to try connecting to the remote host you're interested in, and see whether it fails or not. Maybe doing it in another thread if you don't want it to block your main one? (I don't know how MFC works btw)
  10. Alternative to SDL and DirectX

    Have you followed the instructions linked to in this FAQ? http://www.libsdl.org/faq.php?action=listentries&category=4#47 How exactly did you try to "import the stupid lib and include files into it"?
  11. Regarding the native MacOS X menus, I don't think SDL supports having your application accessing its internal MacOS X/Quartz window handles. At least when you look at the source code for SDL (both 1.2 and the still-in-development 1.3), you'll see the the SDL_GetWMinfo() for Quartz is commented out. But maybe you should try calling SDL_GetWMinfo() anyway, to see what it returns - maybe you're lucky and you'll get a window handle. If you can manage to get a quartz window handle (in some way or another), you'll probably be able to tell it to get a menu by using standard MacOS X functions. If you're really dedicated you might want to hack your own version of SDL to do the job, but remember to release your changes under the LGPL :) Alternatively you might be able to tell SDL to not use quartz but instead go for X11 (by setting the environment variable SDL_VIDEODRIVER to "x11"), which is more throughoutly supported. I guess you can add menus to X11 windows as well. (see http://tronche.com/gui/x/xlib/). But I don't know whether it will get the right "MacOS X feel", and maybe it will confuse your users. Keep in mind that SDL wasn't designed to do this kind of stuff... Are native dropdown menus really necesary? :)
  12. a proxy problem

    It depends on how your network is set up. I've got an user account on a Unix server which is directly connected to the internet. To make my (Windows) laptop, which only can talk to the server, connect to the outside world I've installed cygwin and made an SSH tunnel: ssh.exe -Nf -D PORT USERNAME@SERVER This practically creates a SOCKS5 proxy running on PORT at my laptop.
  13. ODE for high Speeds

    Personally I wouldn't worry too much about having actual real-life values for parameters, I'd be more interested in having the simulation behaving nicely. After all there's so many things you can't model in ODE. Regarding the car falling over... Make sure you've got a very low center of gravity for the car. Ideally you'll probably want to have it centered directly between all the wheels. (As far I remember, the function you're looking for is called dMassTranslate()) Anyway, that will probably not be good enough by itself. It's also a good idea to implement some kind of roll bar (or sway bar, it's called many different things). The idea is simply that if the car cringes to the left, a downward force should be applied on the right side of the car. This will make the car more stable. I don't know how you implement the steering? The steering should be much less aggressive at high speeds than on low speeds, otherwise your car will tip over easily. There's some nice car simulation articles here on gamedev, which also applies to ODE. The "Physics of Racing" series by Brian Beckman is pretty good, although a bit high-level. Check it out here: http://www.gamedev.net/reference/list.asp?categoryid=28
  14. portable texturer

    If you've only got a punch of points, it's difficult to draw a fully textured model from them. The renderer needs to know how these points are connected to each other (i.e. the mesh they define). [url=http://en.wikipedia.org/wiki/Polygon_mesh]http://en.wikipedia.org/wiki/Polygon_mesh[/url]
  15. ODE and friction

    You specifies dContactFDir1 as a flag, which means the friction is dependent on the direction (like in a rolling wheel), but the flag requires you set the fdir1 vector to the main directory - in your case it's probably just <0,0,0> or garbage. You also uses the flag dContactMu2, but doesn't set the mu2 parameter. What effect are you exactly trying to make? Try the following for the simplest friction: contactInfo.surface.mode = 0; contactInfo.surface.mu = dInfinity;