Jump to content
  • Advertisement

TempusElf

Member
  • Content count

    472
  • Joined

  • Last visited

Community Reputation

186 Neutral

About TempusElf

  • Rank
    Member
  1. TempusElf

    HTTP Request with Winsock

    Hey, that seems to have worked. I'm not sure why that would have made such a difference. I should probably read the specifications more closely. Thanks very much.
  2. I'm trying to write a small piece of code that does an HTTP GET. I am able to make the request and retrieve the page just fine, but I can't seem to find a reliable way to detect that I've reached the end of the document. According to the HTTP specification docs that I've read, the server is supposed to close the connection when it's done sending, but it seems that not all of them do. Depending on which server I connect to, the final call to recv either returns zero (as expected) or just never returns at all, leading me to suspect that some of these servers are not closing the connection. My next idea was to capture the "Content-Length" in the response header, but it seems that not every response has that defined... So what am I missing? How do you keep the last recv call from hanging like that? result = getaddrinfo(argv[1], "80", NULL, &aiList); theSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); connResult = connect(theSocket, aiList->ai_addr, sizeof(sockaddr)); HTTPRequest = "GET / HTTP/1.1\nHost: "; HTTPRequest += argv[1]; HTTPRequest += "\n\n"; char buffer[513]; int numRecv; send(theSocket, HTTPRequest.c_str(), HTTPRequest.length(), 0); while( bytesRecv != SOCKET_ERROR ) { bytesRecv = recv(theSocket, buffer, 512, 0); if ( bytesRecv == 0 ) { break; } else { buffer[bytesRecv] = '\0'; cout << buffer; } }
  3. TempusElf

    sort polygons for blending?

    Some people use additive blending to get around the sorting problem... This is not recommended because it only gives the expected results in very particular circumstances. Additive blending works by just adding the source color to the destination color. Because addition is commutative, the polygons can be rendered in any order. This sounds like a brilliant idea, until you try it out and discover that it only works in situations where the background is very dark. It might work in a dark dungeon (maybe) but not in an outdoor scene with a bright blue sky. You'd think it would work in a space game, but then the white stars in the background will shine right through looking very strange. The reason is that white + any other color = white. Edit: Oh wait, were you saying that you thought you had to sort ALL of the polygons in the scene? I'm pretty sure that you could get away with just rendering the transparent ones last and sorting them, like what Gavinl is saying.
  4. TempusElf

    skybox woes (looks flat)

    The lines on the edges is an issue I still struggle with (note that I haven't really spent much time trying to fix it either) However, the trick to making skyboxes look correct is to create the images using a camera (virtual or real) that has a 90 degree field of view. I haven't made any really cool skyboxes. But when I try, I use Blender and mess with Blender's camera object to give it a 90 degree field of view.
  5. TempusElf

    md2 texturing

    Quote:Original post by Endar I thought this was strange, so I tried texturing with another texture, something which wouldn't properly fit on the model, but something that I would at least be able to see. The texture had a lot of blue, so the model ended up turning blue (a single color, not several shades). This makes me think that there is something wrong with the texture coords on the model... If you are able to render other md2s just fine, then when you performed the test stated above you would have expected the model to look like a mess of colors from the not-matching texture... even if the texture was not the standard size, you'd think that you would see more than one color. is there a way to make sure that the model has texture coordinates that look right?
  6. TempusElf

    Making money without working?

    You could buy one of those video rental machines, which are sure to be a total scam... but after assuming the risk of people just keeping the videos and paying for your location, you might make $50-100 a week. Speaking of that... I wonder how easy it is to own a good old-fashioned vending machine
  7. TempusElf

    favorite video game?

    1. Morrowind 2. Daggerfall 3. System Shock 2 4. Deus Ex 5. Ultima Underworld I like games to be at least somewhat open-ended and complex.
  8. TempusElf

    loadPNG/libPNG Newbie-question...

    One way or another, gcc does not know that you are trying to link to libpng.a Try explicitly telling Dev-c++ to link with it. Go to Project->Project Options->Parameters->Add library or object you may need to add allegro and libz that way too I hope that helps
  9. TempusElf

    save ram by reducing color channels?

    Is there any way to reduce the space my texture takes up without reducing the texture's resolution or writing a pixel shader? Would the pixels of a palletized texture just be rolled out into 32 bit RGBA pixels too?
  10. I wanted to reduce the amount of video ram my app was taking up by replacing one of my textures with a grey-scale version of the same texture. However, when I looked at GL_LUMINANCE in the documentation it said this: Quote: Each element is a single luminance value. It is converted to floating point, and then assembled into an RGBA element by replicating the luminance value three times for red, green, and blue, and attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Does this mean that even though I'm using a grey-scale image it's still going to take up the same amount of space as my original image?
  11. so I wanted to write a function that multiplies two 4x4 matrices and this is what I came up with: void matrixMultiply(const float a[16], const float b[16], float out[16]) { out[0] = a[0]*b[0]+a[4]*b[1]+a[8]*b[2]+a[12]*b[3]; out[1] = a[1]*b[0]+a[5]*b[1]+a[9]*b[2]+a[13]*b[3]; out[2] = a[2]*b[0]+a[6]*b[1]+a[10]*b[2]+a[14]*b[3]; out[3] = a[3]*b[0]+a[7]*b[1]+a[11]*b[2]+a[15]*b[3]; out[4] = a[0]*b[4]+a[4]*b[5]+a[8]*b[6]+a[12]*b[7]; out[5] = a[1]*b[4]+a[5]*b[5]+a[9]*b[6]+a[13]*b[7]; out[6] = a[2]*b[4]+a[6]*b[5]+a[10]*b[6]+a[14]*b[7]; out[7] = a[3]*b[4]+a[7]*b[5]+a[11]*b[6]+a[15]*b[7]; out[8] = a[0]*b[8]+a[4]*b[9]+a[8]*b[10]+a[12]*b[11]; out[9] = a[1]*b[8]+a[5]*b[9]+a[9]*b[10]+a[13]*b[11]; out[10] = a[2]*b[8]+a[6]*b[9]+a[10]*b[10]+a[14]*b[11]; out[11] = a[3]*b[8]+a[7]*b[9]+a[11]*b[10]+a[15]*b[11]; out[12] = a[0]*b[12]+a[4]*b[13]+a[8]*b[14]+a[12]*b[15]; out[13] = a[1]*b[12]+a[5]*b[13]+a[9]*b[14]+a[13]*b[15]; out[14] = a[2]*b[12]+a[6]*b[13]+a[10]*b[14]+a[14]*b[15]; out[15] = a[3]*b[12]+a[7]*b[13]+a[11]*b[14]+a[15]*b[15]; } great... so I keep on coding and then I realize that this function will screw me if I want to do something like this: matrixMultiply(m1, m2, m1); The only way I can think to resolve this problem is to create a temp matrix and then copy all of the values over to the out[] matrix Is there a better way to solve this problem?
  12. good call... I didn't think of that part but assuming that I go ahead and do the void foo(int*& array); thing would the array deallocate properly?
  13. Would the following code produce a memory leak? void CreateArray(int* array) { array = new int[100]; return; } //over in main or some other function int * a; CreateArray(a); delete [] a; I'm not quite sure why I'm asking... for some reason my this-is-a-bad-idea sense is tingling [Edited by - TempusElf on June 24, 2005 6:35:30 PM]
  14. TempusElf

    Mystery Science Theater 3000

    Quote:Original post by Maega Search "The Mystery Science Theater 3000 Collection" I think it's up to Vol. 7 by now. you got my hopes up... I thought they were finally releasing full-season DVDs That will not happen until some very smart person buys the rights to all of the movies and all of the episodes... this may never happen... anyway: 1. Laser Blast <-- my absolute favorite 2. The Magical Voyage of Sinbad 3. Mitchell* 4. Pod People* * -> episodes you can buy from not-ebay, released by Rhino
  15. Are there well known and practical methods for getting collision detection between two animated models/meshes down to the polygon level? I know that I could easily keep models from walking into each other by using bounding volumes... However, If I then want to go to the next level and see if the polygons are actually colliding I can't think of how I would go about doing that... My initial thought was to just test for intersection between the models as they are shaped right now as if they were not moving. But it seems to me that this is very dangerous because the models could potentially change shape enough during that frame that the resulting collision response looks ridiculous. The reason I ask this question is because in the game I'm planning to work on, I want the characters to engage in close combat. So, if I have two characters in a fist fight or a sword fight, I want to be able to accurately see if the fist hit the enemy or if the sword hit a shield... How might this be done?
  • 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!