Search results

  1. saw792

    Z notation simple exercise

    You need to post the given types as well as the defined constants and then we can help you. It sounds like you're asking for us to do your homework question and I'm not willing to just solve it for you, although I will happily help you along the right track. Post what you currently have.
  2. saw792

    VS C++ added code acting weird

    void DrawCircle (HDC hdc, int radius, int num) { <=======================
  3. saw792

    Game Loop involving GLUT

    Pretty much right about the basic drawing display lists/transformations part. You're right about the state machine being the explanation for your second question. When you call glBindTexture() it binds the current GL_TEXTURE_2D name to your id. This means any operations involving GL_TEXTURE_2D...
  4. saw792

    Game Loop involving GLUT

    The whole point of display lists is to conserve the shape of the objects you are drawing. Unless you are actually distorting the shape you can use them in conjunction with glScale/glTranslate/glRotate operations to actually put them where you want them and move them. To take advantage of this...
  5. saw792

    Game Loop involving GLUT

    The binding of glBindTexture is persistent for the life of the program. That is, if you call it once then every primitive with texture coordinates that you draw will use that texture until you change it. The OpenGL environment is a big state machine. Most/all gl calls you make change the state...
  6. saw792

    Anyone have any idea how to parse over w3u,w3i,w3a, and wts files in mpq for icons?

    http://www.thehelper.net/forums/showthread.php/42787-Guide-Explanation-of-W3M-and-W3X-Files According to that, you should look up what the modification ID is for the icon path in the appropriate MetaData.slk files, then scan through the file. Each time you find a modified object record it. If...
  7. saw792

    Anyone have any idea how to parse over w3u,w3i,w3a, and wts files in mpq for icons?

    He's trying to map icon paths/files to their associated default and custom objects from the Object Editor. Which means he needs to find unit/ability/item/etc IDs for each custom or non-default icon he finds in each map. I imagine the simplest approach to the entire database would be to...
  8. saw792

    How does this code do what it does and why did the coder code it this way(pixel+SDL)

    Continuing the example given in the quote: If you want the blue pixel stored in row 1, column 1 you are actually requesting the pixel stored at index 6 in the pixel array. This is demonstrated in the pictures in the quote. So every time you go down a row you are actually jumping across in the...
  9. saw792

    Adding two 2D vectors.. ?

    Well generally if you want to change the velocity you do so by applying an acceleration. Eg: Your ball hits a powerup which pushes boosts it to the right. Implementation would simply involve adding a constant amount to the y acceleration for a few ticks (another option is just adding to the y...
  10. saw792

    Adding two 2D vectors.. ?

    Well the more common way to do something like this is to use multiple vectors for different parts of the balls movement. For example, you use one vector {x, y} for the ball's position, a vector {xvel, yvel} for the ball's velocity and (perhaps) another vector {xaccel, yaccel} for the ball's...
  11. saw792

    Adding two 2D vectors.. ?

    It's a strange thing to be representing vectors in polar form. It's much more common to use an {x, y, z} type representation as operations on the individual directional components tend to be more common. Why have you chosen a polar representation?
  12. saw792

    MySQL Connector/J not working when packaged into a jar

    The exception text should appear in the console window. If you are running it by double clicking the jar run it from a command line using 'java -jar JarName'.
  13. saw792

    Z-notation ?

    ... Languages are tools. You don't know a language the same way you don't know a hammer. You might know how to use a language, but overall it is just a tool you are using to perform some task. Courses that claim to teach you programming languages are misguided; they often teach you very little...
  14. saw792

    Avoiding Polar Projection

    I'm glad you understand, it just becomes misleading for people if you say things that can be interpreted as "sin and cos implementations are always slow". I also think that the results achieved from a GOOD hardware/efficient table/algorithm/whatever implementation are going to be significantly...
  15. saw792

    Avoiding Polar Projection

    Now that's going to need some serious proving.
  16. saw792

    Ray and Ellipsoid intersect

    Your description of an ellipsoid does not take into account rotation at all, which means that you can skip the rotation matrix completely or (perhaps more sensibly) allow for rotations in the future by leaving a placeholder there (which would be the identity matrix). If you want to add rotations...
  17. saw792

    Ray and Ellipsoid intersect

    Fortunately, there is a simpler way to go about doing this. An ellipsoid can be represented as a sphere that has had some transformations applied to it: 1. Scaled in the x, y and z directions (for the different radii) 2. Rotated about the origin in x, y and z directions (requires two angles)...
  18. saw792

    Ellipsoid as a Matrix

    You cannot represent every ellipsoid with the parameters you have described, only axis-aligned ones in case you weren't aware. Anyway, there is no 'proper' way to represent an ellipsoid; it depends on what sort of operations you want to perform on it as to what the best representation is...
  19. saw792

    [Java] More help needed (arraylists, getting etc.) :/

    I'd just like to take this opportunity to clarify something for you. The toString() method in any class is designed to create a string representation of (an instance of) an entire class. Sometimes it's difficult to think immediately what that representation should be, so here are a few examples...
  20. saw792

    [Java] More help needed (arraylists, getting etc.) :/

    Really what you want is to create a constructor that sets the mother and father, as these are things that can't logically be changed. So something more like:public class Person { public Person(Person newmother, Person newfather} { children = new ArrayList<Person>(); mother =...
Top