Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About MarauderIIC

  • Rank
  1. MarauderIIC

    Time Travel...Impossible?

    Well, they're related somehow, aren't they? Enough to where you could apply the same theory eventually, I mean. Sorry, don't know much physics. :P
  2. MarauderIIC

    Time Travel...Impossible?

    Quote: but experiments have been succesful with the smallest of quantum particles. Really? So what's special about quantum particles that makes it still impossible to do it with anything else? Or is this statement false...? Edit: I'm curious; I don't know. Oh... and if you "sent it back" wouldn't you not be there anymore? If there is no backwards in time. (So you're saying that they decided to send a quantum particle back and it appeared before they sent it, yes? So what if they saw it appear and went, "nah im not going to send it" ? *confused* "Imagine what you will know...tomorrow."
  3. MarauderIIC

    Pixels - Texels?

    640 x 480 is the quad size and the bmp size. Will see about getting rid of mipmap..
  4. MarauderIIC

    Pixels - Texels?

    Which is funny, because if I put "20" in for the x-coord of glTexSubImage2d it renders at 25, according to my mouse pointer coordinate finder thingy. (And it's at the wrong place on the texture, ie, it doesn't line up). Edit: Did some math between where it was drawing it and where it is supposed to be, and I have to divide the x-coordinate (20) by 1.25 to get it to place it at 20 and not at 25, and the y-coordinate has to be divided by 1.0638297872340425531914893617021 (whee!) for it to place at the number I put. :/ I figure I have something screwed up.
  5. MarauderIIC

    Pixels - Texels?

    I have an Ortho screen set up to 640x480, which is also my window's resolution. I have a quad (with a mipmapped texture so I don't have to find the nearest power of two myself atm :P) and I'm trying to edit a part of it with glTexSubImage2D(). However, it takes texels for parameters and not pixels, so how do I convert from a pixel coordinate to a texel coordinate (of my background quad, which is what I'm editing)? And secondly, the image I have seems to come out a bit squished. Any solutions out there?
  6. MarauderIIC

    Regenerate only part of an image?

    Ah, it's glTexSubImage2D.
  7. I have the following code: } else { for (unsigned int pixelYFill = bottom;pixelYFill <= top;pixelYFill++) { for (unsigned int pixelXFill = left;pixelXFill <= right;pixelXFill++) { // getRGBA(landRes[pixelYFill][pixelXFill], r, g, b, a); getRGBA(landRes.at(pixelYFill).at(pixelXFill), r, g, b, a); pixelDataRes[pixelYFill][pixelXFill][0] = (float)r/255.0; pixelDataRes[pixelYFill][pixelXFill][1] = (float)g/255.0; pixelDataRes[pixelYFill][pixelXFill][2] = (float)b/255.0; pixelDataRes[pixelYFill][pixelXFill][3] = (float)a/255.0; } } } GLuint temp; glGenTextures(1, &temp); glBindTexture(GL_TEXTURE_2D, temp); landGen->setTexture(temp); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); gluBuild2DMipmaps(GL_TEXTURE_2D, 4, resWidth, resHeight, GL_RGBA, GL_FLOAT, pixelDataRes); Of course, it lags like crap, which is my problem. Is it possible to only regenerate the part of the image contained within (bottom, left) (top, right) ? I mipmap because the image is 640x480 (at the moment) and it's not powers of two. This function is called whenever part of the image changes (it's "destroyable" terrain-like stuff).
  8. MarauderIIC

    Time Travel...Impossible?

    You'd just need a really really big telescope to catch all the light that spread out and probably a clear shot so that nothing was in the way. :)
  9. I have a function that draws some text and a man on the screen. The text works on every computer I have tested it on, but the man does not, and yes, the texture is loaded. So: every computer draws the text, but not every computer draws the man and the bounding box (enough of my friends, that is, to where I think it might be a slight coding error). Anyone see any problems? EDIT: Aha! I had to move all the text after the drawing. I guess I change something in glPrint(). Will investigate. void World::startOrtho(float x, float y, float nearclip, float farclip) { glMatrixMode(GL_PROJECTION); //Select projection matrix glPushMatrix(); //save it glLoadIdentity(); //reset non-saved glOrtho(0, x, 0, y, nearclip, farclip); //Set up an ortho screen glMatrixMode(GL_MODELVIEW); //Select modelview matrix glPushMatrix(); //save it } void World::stopOrtho() { glMatrixMode(GL_PROJECTION); glPopMatrix(); //Select old projection matrix glMatrixMode(GL_MODELVIEW); glPopMatrix(); //Select old modelview matrix } //.... glDisable(GL_DEPTH_TEST); //Settings... glDisable(GL_LIGHTING); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); drawPlayers(); //.... void World::drawPlayers() { //..... //frameWidth is the width of the player's current image //frameHeight is same for height. //zvalue is the player's z-coordinate curPlayer->setBound(0, 0, false, false); curPlayer->setBound(frameWidth, 0, false, true); curPlayer->setBound(frameWidth, frameHeight, true, true); curPlayer->setBound(0, frameHeight, true, false); if (zvalue >= 0) startOrtho(640, 480, -zvalue-1, zvalue+1); else startOrtho(640, 480, zvalue+1, -zvalue-1); glLoadIdentity(); //Reset coordinates. glDisable(GL_DEPTH_TEST); //Settings... glDisable(GL_LIGHTING); glEnable(GL_BLEND); glEnable(GL_TEXTURE_2D); glColor3f(1, 1, 1); glTranslated(curPlayer->getCoord('x'), curPlayer->getCoord('y'), 0); glPushMatrix(); //Rotate around player's center--------------------- glTranslated(frameWidth/2, frameHeight/2, 0); glRotatef(curPlayer->getAngle(), 0, 0, zvalue); //Don't let him be upside down. if (curPlayer->getAngle() > 90 && curPlayer->getAngle() < 270) glRotatef(180, 0.5, 0, 0); //Move back to bottom left. glTranslated(-frameWidth/2, -frameHeight/2, 0); //Bounding box-------------------------------------- glDisable(GL_BLEND); glDisable(GL_TEXTURE_2D); glLineWidth(1.5f); glDisable(GL_LINE_SMOOTH); glColor3f(0.0f, 1.0f, 0.0f); glBegin(GL_LINES); glVertex2d(0, 0); glVertex2d(frameWidth, 0); glVertex2d(frameWidth, 0); glVertex2d(frameWidth, frameHeight); glVertex2d(frameWidth, frameHeight); glVertex2d(0, frameHeight); glVertex2d(0, frameHeight); glVertex2d(0, 0); glEnd(); glBlendFunc(GL_DST_COLOR, GL_ZERO); glBindTexture(GL_TEXTURE_2D, manAnim->getCurFrame()->getMask()); //mask glBegin(GL_QUADS); glTexCoord2f(0, 0); glVertex2d(0, 0); glTexCoord2f(1, 0); glVertex2d(frameMaskWidth, 0); glTexCoord2f(1, 1); glVertex2d(frameMaskWidth, frameMaskHeight); glTexCoord2f(0, 1); glVertex2d(0, frameMaskHeight); glEnd(); //Character texture--------------------------------- glBlendFunc(GL_ONE, GL_ONE); glBindTexture(GL_TEXTURE_2D, manAnim->getCurFrame()->getPicture()); //texture glBegin(GL_QUADS); glTexCoord2f(0, 0); glVertex2d(0, 0); glTexCoord2f(1, 0); glVertex2d(frameWidth, 0); glTexCoord2f(1, 1); glVertex2d(frameWidth, frameHeight); glTexCoord2f(0, 1); glVertex2d(0, frameHeight); glEnd(); glPopMatrix(); glColor3f(1, 1, 1); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glPrint(0, 48, ("Player position: " + itos(curPlayer->getCoord('x')) + ", " + itos(curPlayer->getCoord('y')) + ", " + ftos(zvalue) + "."), 1, fonts()->getFont(0), 255, 255, 255); glPrint(0, 64, ("Velocity: " + ftos(curPlayer->getSpeed(0)) + ", " + ftos(curPlayer->getSpeed(1)) + ", " + ftos(curPlayer->getSpeed(2)) + "."), 1, fonts()->getFont(0), 255, 255, 255); glPrint(0, 32, ("Terrain type @ mouse: (" + itos(mouse.getX()) + "," + itos(mouse.getY()) + ") " + itos(getType(mouse.getX(), mouse.getY())) + "."), 1, fonts()->getFont(0), 255, 255, 255); stopOrtho(); } [Edited by - MarauderIIC on July 19, 2004 1:30:27 PM]
  10. I have an image that is 50x64, and when I mipmap it it is torn in half and each half is sort of tilted at an extreme angle. 51x64 does not work either. However, my 52x64 image works fine... I assume there's a size restriction on gluBuild2dMipmaps(), but what is it?
  11. I have a thing I made, it draws a man on the screen w/ a mask and a green bounding box and writes the coordinates he's at. Pressing space makes him "shoot" a projectile. Pressing c changes the cursor to an image that uses a mask. Both the projectile and the cursor work on other person's computers. (Two different people). However, the man and his bounding box do not draw, whereas the text in the same function shows up... This works fine on my computer, though -- the man, bounding box, and text all show up. Any ideas as to what the problem might be? (Or if it's even my problem?) [Edited by - MarauderIIC on July 18, 2004 2:50:56 PM]
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!