randomZ

Member
  • Content count

    351
  • Joined

  • Last visited

Community Reputation

163 Neutral

About randomZ

  • Rank
    Member
  1. While you have a z-axis in orthogonal projection mode, you won't have any distortion with regards to perspective, so it doesn't matter what Z depth an object is actually at. So in this case, you should be able to pick an arbitrary value for the mouse depth.
  2. [OpenGL] glRotatef causing rendering errors?

    Are you defining any lights at all? If not, you shouldn't enable lighting. Apart from that, your code looks fine... I don't know if lighting could cause such bugs.
  3. Why does it matter? I don't know much about shaders, but if you don't use the values, it doesn't matter what values they contain, doesn't it? How do you even find out what values you get without accessing them? ^^
  4. OpenGL Fonts with OpenGL

    If you want a source of inspiration on how to implement a flexible font manager using Freetype 2, check out this tutorial. Beware that the code is written in D, but should be entirely understandable for a C++ programmer.
  5. how do you pass arrays to a function?

    Perhaps you should explain what you are trying to do with these functions or post an example how you're trying to use them. I don't see any mistake in the declarations you posted. What you basically need to know is that when you are passing an array as an argument, you are actually passing a pointer to the first element. Thus, void myFunc(int myArray[]) is equivalent to void myFunc(int* myArray) and myFunc(myArray); is equivalent to myFunc(&(myArray[0])); Of course, this also means that you can use the [] indexing syntax on normal pointers, which of yourse you shouldn't do. This also means that arrays are always passed by reference rather than by value (if you don't know what this means, look it up); i.e. if you modify the array in the function, the original array will be modified, too.
  6. FTP Upload Problems: Upload stops after 8KB

    Updating the firmware seems to have done the trick. Of course I might have come up with that myself ^^ Thanks again :)
  7. FTP Upload Problems: Upload stops after 8KB

    Yes. This was the first thing the support guy asked, too ^^ I've also tried various FTP programs: SmartFTP, WS_FTP LE and Total Commander.
  8. Hi, I'm experiencing FTP upload problems with the servers of various free webspace providers. The problem is that uploads just stop after 8KB of a file have been transferred, and the connection times out. (Smaller files than 8KB are transferred correctly.) However, upload to some other servers seems to work. I've already contacted support of one provider, but all they could tell me was to lower the MTU value, which I did in my router's settings, from previously 1492 to 1460. I'm using a netgear router, in case that might be the problem. Does anyone have any experience with that type of problem? Thanks alot Sebastian
  9. Off Topic (But Interesting)

    However, I wouldn't overuse it - it mostly makes for unreadable code. You can even put more ?: conditionals into the if condition, but if a reader needs five minutes to figure out one line of code, that code isn't worth much. For example, even this slight change: if(min(a, b) < 7) { ... } with min() defined elsewhere is way easier to read, because you moved the additional condition *out of* the if statement.
  10. Freetype question

    To draw TTF fonts to an SDL window, use SDL_ttf. SDL_ttf uses Freetype anyway, but you don't need to worry about it.
  11. OpenGL .png files....

    I'm afraid these are statically linked to SDL_Image, so there's nothing you can do short of recompiling SDL_Image. They're not huge, though, so including them shouldn't be a pain.
  12. Two friends and me made a game for a 72hour competition back in december. The game is kind of a mixture of Lemmings and The Incredible Machine: You need to help the main character reach the level exit by placing bricks and jump markers in the level; all of this in 2d. (You can find the current version of the game at my website.) However, the collision detection is very buggy. Let me illustrate the problem: Currently, the whole world is made up of bounding rectangles (axis-aligned). Collision is checked by checking whether two of these rectangles overlap. However, we also need to know what side of the brick/enemy the player collided with to determine the reaction (turn around, die etc.). E.g., there are bricks who are harmless if touched from above but lethal from any other direction. To check from what direction the collision occured, the overlapping rectangle is examined. If its width is greater than its height, the collision occured from above or below. If its height is greater than its width, the collision occured from the left or right. Obviously, this last part introduces bugs, e.g. when the falling velocity (or *any* velocity, for that matter) is high. So I'm looking for a better way to accomplish this. Some things I already came up with: - Make everything pixel-based and move the player only one pixel at a time. Con: I'd need to rewrite most of the game, since right now it's all floating-point ^^ - Do intersection tests from the player's corners moving with the player's velocity. E.g.: player - moves to the bottom-right ---- | |\ | | \ ---- \ \ \ \ \ \ \ \ \ \ \ ---- \ | | \ | | \ ---- \ brick Since the ray that hits the brick first hits it from above, the hit is from above. But what if the object is small enough that none of the rays hits it? Has anyone got any other suggestions? I'm sure many people have done jump'n'runs before :)
  13. Classes

    But what happens if you want to have a small, shooting paddle and a large shooting paddle and a small sticky shooting paddle? IMHO, plain inheritance often isn't the right pattern.
  14. % in strings?

    I was meaning to say, "The reason this is incorect is...", that is, I was agreeing with Fruny.
  15. Problem with fps ( openGL + SDL )

    BTW, don't turn off VSYNC. VSYNC is good for your graphics.