Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About kspansel

  • Rank
  1. kspansel

    Frustum Culling Dx9

    You need to initialize "ret" to true. Additionally: 1. Get out of the loop as soon as the plane test returns false (no point in checking the other planes if we're already out!) 2. No need to calculate P if you're not going to use it -- Kory
  2. kspansel

    [D3D11] Depth buffer does nothing

    Just a shot in the dark, but is it possible one of your shaders is disabling the depth buffer or depth writes? -- Kory
  3. kspansel

    Spinning a wheel and stopping at a given angle

    Thanks for the replies. I've come upon a solution that does what I need. You were both correct, I needed an equation I could solve for the angle, which I knew. However, the real problem was the fact that I was dampening the speed by a percentage each frame, thus giving me some funky exponential function based on the frame number. Making the resistance linear simplified things and allowed me to solve the equation. Basically, I did this: 1. Calculate the amount of time needed to slow the wheel's speed to zero, from its current speed. 2. Calculate the angular distance traveled in that time. 3. Using that distance and the ending angle, calculate the angle where the wheel needs to start slowing down to land on the given angle. 4. Once the wheel reaches the starting angle, it begins to slow down and eventually stops near the desired angle. It's not perfect, but it works. Thanks! -- Kory
  4. Lets say I have a 2D circle that represents a Party Wheel. The circle is divided into several pie shaped slices of 2 different sizes. The idea is that the player spins the wheel and after a couple of rotations it eventually slows down and stops on a specific slice. So, my question is, once the wheel is spinning, how do I calculate the amount of resistance needed to slow the wheel down and stop on the correct slice? Currently, I just track the speed and angle and dampen the speed by a percentage each frame. This definitely slows the wheel down, but calculating the amount of dampening needed to land on a specific slice is difficult. I'm open to other approaches too. As long as it looks like a spinning party wheel that slowly stops on a given slice, then it fits my needs! Thanks! -- Kory
  5. kspansel

    How To Develop a Demo RTS/FPS Engine?

    If you can spare the 100 bucks, get Torque. It's a designed to be an FPS engine, but you can also purchase (for another 50 bucks) an RTS starter kit. I grabbed it about a month ago and it works great (didn't get the starter pack, though, cause that's the code I wanted to write!). I was somewhat disappointed at the lack of up-to-date resources (i guess they're focusing on the shader engine instead), but for a $100 you can't beat that! -- Kory
  6. kspansel

    Applied Torque [RESOLVED]

    For every 1 meter you can divide it into 100 centimeters (ie. 1m/100cm). So if you have 50cm, then you have 50cm * (1m/100cm) = .5m The most important thing is that the units cancel. Doesnt make a difference if your talking 1 meter per 100 centimeters or .01 meters per 1 centimer. -- Kory
  7. kspansel

    Is this code bad?

    Well, the first question is: Why? What is the point of the templated ALLOCATOR class? -- Kory
  8. kspansel

    Ground simulation

    Another interesting solution would be to use cellular automata. This would handle the "floating islands" very nicely. Haven't done anything like this myself, but it is another option. There's a nice article in GP Gems 3. -- Kory
  9. kspansel

    Strange fread problem.

    Instead of rewind, try: fseek( stream, 0L, SEEK_SET ); -- Kory Spansel Pipeworks Software Inc.
  10. I don't have much experience in this realm but you could try: int bit = (in[bp >> 3] >> (bp & 0x7)) & 1; bp++; That atleast gets rid of the division and remainder ops, but I wouldnt be able to tell you how much faster it is, probably fairly insignificant. If it's ease of access you want, you could use a bit field: struct OneByte { unsigned char bit0 : 1; unsigned char bit1 : 1; unsigned char bit2 : 1; unsigned char bit3 : 1; unsigned char bit4 : 1; unsigned char bit5 : 1; unsigned char bit6 : 1; unsigned char bit7 : 1; }; Again, like I said, I'm not really familiar with huffman encoding, but the best thing to do (if possible) is not to work with single bits directly. If you know which bits you need in each byte, mask those out and recombine them into a full byte (I'm assuming you will need the full byte anyway). Hopefully, that was atleast somewhat useful. -- Kory Spansel korys@pipeworks.com
  11. Hi, I'm wondering if it is possible to redirect a file download through CGI? I have a simple intranet web-interface to download backups of our various game assets and the log files associated with them. Each of the backup files are renamed (at the time of the backup) to have the date- and time-stamp encoded into the file name. The problem is that the game needs the asset file to have a certain name, and I don't want the artists or other users of the interface to have to manually change the file name after they download it. Let's say I have a file (on the server machine) called ABC_04262005_1100.xyz and I click the link to download it. I would like the save dialog to attempt to save the file as ABC.xyz and not ABC_04262005_1100.xyz, does anyone know if this is possible? Note, one thought that crossed my mind was to copy the file to a temp file with the correct name, but alas I don't believe that will work well for my situation, as each of the files are ~2GB each, and I can't have people waiting many minutes to start the download. In addition, I think this approach would require some checks to make sure I don't try to copy over a file in the process of being downloaded. I'm using the latest version of Perl and Apache 2.0 for the CGI interface. Any comments and suggestions welcome. Thanks -- Kory
  12. kspansel

    Problem doing some calculations

    Seems fine to me. Since it's a zero-based index (block 0 through block 37 is actually 38 blocks total) your getting the "block" index. If you're trying to figure out how wide the map is in blocks just do: width in blocks = int(width in pixels / 32) + 1; -- Kory
  13. I just started doing some mobile development and I was wondering if Samsung has an SDK for their mobile phones? I have an SGH-E715 and I would like to be able to access pixels directly. I've searched all over their site, but I haven't found anything. At the moment I'm using J2ME/MIDP2.0 but it doesn't offer the capabilities that I need. Also, what is the best way to keep your game images resolution independent? Creating seperate graphics for each resolution just isn't feasable. Any ideas? Kory
  14. kspansel

    YawPitchRoll on a point?

    Google for object picking. What it sounds like to me is you want to basically select objects using the mouse. Is that correct? If so cast a ray (in world coordinates) and check for a collision between your plane (quad) and the ray. Kory
  • 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!