Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

144 Neutral

About MadsGustaf

  • Rank
  1. i am not to sure about how to do this apart from the fact that i probaly needs to use the triangle fan to make the circle and then use glTexCoord. this is how i currently draw the circle using triangle fan. void drawCircle(float radius) { glColor3ub(255,0,255); glBegin(GL_TRIANGLE_FAN); for (int i=0; i <= 360; i++) { float degInRad = i*DEG2RAD; glVertex2f(cos(degInRad)*radius,sin(degInRad)*radius); } glEnd(); } still not to sure how to make the rectangular image onto the circle using the glTexCoord. Thanks in advice.
  2. MadsGustaf

    a favor to ask.. for U.S residents only

    wow! i had no idea something like that existed, thanks for the heads up! rating++;
  3. I am trying to buy a few pokemon t-shirts from the website hottopics.com for my little brothers birthday(he has been in love with them for several months now). Unfortunately they only ships to the united states, so i would need someone who lives there (you!). So i can send the package to your address, and then you can ship it to mine. i will pay all expenses in advance/beforehand, so you wont be spending any money that you don't have, plus 20$ for the trouble. The last 10$ when i have gotten the package. Please write here or PM me or add my msn: madsj_6[at]hotmail[dot]com for further information :). I apologizes for the bad English, but i hope the message was clear. Thanks in advance, Mads.
  4. MadsGustaf

    [2D] Distance from a point to a line segment

    Sorry, but could you elaborate on this Quote: ....and v is the (normalised) direction of the line. I may just be confused by the notation (aka my obviously weak math) p.v and A.v(/B.v)
  5. Hello. I have set up a projection matrxi, so this is in 2d. After having done several translation and rotations, i would like to get the current position that is the origin for further drawings before calling glLoadIdentity()/popback. How would i do this?. [Edited by - MadsGustaf on April 1, 2008 4:25:29 PM]
  6. I have a point(x,y) and a line between two points (x1,y1) and (x2,y2) I am currently using the following code to compute the distance between the point and the line, however i am not getting the correct result ( i am getting a constant value every iteration): [source langg = "cpp"] float A = x - x1; float B = y - y1; float C = x2 - x1; float D = y2 - y1; float dot = A * C + B * D; float len_sq = C * C + D * D; float param = dot / len_sq; float xx,yy; if(param < 0) { xx = x1; yy = y1; } else if(param > 1) { xx = x2; yy = y2; } else { xx = x1 + param * C; yy = y1 + param * D; } float dist =sqrt( ((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)) ) ; cout << dist << endl; I am using a coordinate system increasing going from up to down(y) and from left to right(x).
  7. MadsGustaf

    Contact vector and rotation.

    This is what i would want: Click Me in case 1) i dont want to handle any specific collisions (as the green square does not intersect with the side of the red square outlined by the blue line). This is what i currently have on all sides of the square. In case 2) the green square does intersect the blue line of the red square, so i would like to proceed a special collision response, but how do i determine if the green square is oversecting the blue line at any rotation? The general physics collision/response is handled by the physics engine, but i have acces to the vertices of the squares, rotations and contact vectors.
  8. Hello. I have two polygons (lets just say squares). I only want to handle collision response if the square is colliding against one specific side. Without rotation, i would just look if the contact vector was above or equal to the squares top border coordinates. When the squares are rotating, i am not quite sure how i would do this. [Edited by - MadsGustaf on April 1, 2008 12:16:57 PM]
  9. MadsGustaf

    virtual confusion

    I have two classes, a sprite class, and a class Jimmy class derived from sprite. The update function is virtual, but for some reason it crashes when i call it: [source langg = "cpp"] class Sprite { public: virtual void update() { std::cout << "Sprite class update called" << std::endl; }; }; class Jimmycracker: public Sprite { public: void update() {std::cout << "Jimmy class update called" << std::endl; }; } ; .......................................... Jimmycracker* Jimmy = &Jimmycracker(); void* userdata = (void*)Jimmy; Jimmycracker* spr = (Jimmycracker*)userdata; spr->update(); it crashes at spr->update();. If i wanted the example above to work with both Sprites and Jimmycracker's, what would i do?.
  10. MadsGustaf

    HEMO - Homicidal Emo

    Yes. i apologize for the crazy resolution (1280x720), it was designed as a wide screen game on my laptop (which has a much greater resolution). All points taken :). Unfortunately, i am not going to work on this game anymore as it was done in 4 days for the experimental gameplay project. But i will keep all of your points in mind for future projects :).
  11. MadsGustaf

    Planet Umi: my pygame project

    Agree with Oluseyi :) Looks really nice and clean. I sat and starred at the Umi's wander around for about 10 minutes hehe :P Very calming and relaxing music. Hope you will keep on working on this!
  12. MadsGustaf

    HEMO - Homicidal Emo

    This is my first ever (published) game :). A bunch of emos are trying to kill themselves. Don't let them get to the other side! Control Amor with the mouse to shoot sad emos with love filled arrows. Try to keep them off the boundaries for as long as possible. This game uses: SDL,SDL_image,SDL_mixer,SDL_ttf,OpenGL and Box2d. Click me My personal record is 210seconds. I would really appreciate ANY feedback :D.
  13. MadsGustaf

    I have managed my fear!

    After ½ year of leaching on other games's compiled libraries... I finally figured out how to compile libraries :D. I compiled SDL (i needed it as /MT)! And i did not stop there. Nono! I compiled SDL_image,SDL_mixer and SDL_ttf too! I went all the way, baby. I AM ON FIRE. Phew. Feels good to finally having nailed it. (it was surprisingly easy -_-')
  14. MadsGustaf

    Compiling SDL_ttf

    Hello. I am trying to compile SDL_ttf as i need it under /MT. I have followed the instructions described on this page as to how to compile FreeType under /MT. http://libagar.org/docs/compile-msvc.html.en I am getting this error when i try to build SDL_ttf. Quote: The application failed to initialize properly (0xc000007b).Click on OK to terminate the application. I am using MSVC++ 2008
  15. MadsGustaf

    SDL console window questions

    you are probably running on /SUBSYSTEM:CONSOLE in MSVC++ you would do the following: go to project properties>Linker>System>Subsystem and change from Console to Windows
  • 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!