• Content count

  • Joined

  • Last visited

Community Reputation

128 Neutral

About brain21

  • Rank
  1. Hi, I have a small bitmap (160x30) and I want to scale only on the X. I was thinking of having a matrix the described the changes between the source and destination images so that I could say "for each pixel in the destination image, what pixel in the source image should I copy". I'm not sure how to populate the matrix though. Any suggestions or betters ways of doing it. I'd like to scale it smoothly. Denis.
  2. OpenGL OpenGL Libraries

    Hi, Thanks, I found it. It's funny that vista didn't find it when I did a search for it. Brain21
  3. Ok, so I'm searching for the .libs for Visual C++ 2008 Express. I've been to and searched for hours and found nothing. Google keeps leading me to sites that say that msvc++ comes with them, but I don't have them. Where can I download the latest version? Oh, I'm using Vista and Xp. Denis.
  4. Hi, I wrote this program to simulate circles accumulating into lanes on a conveyor, but after adding 300 circles, the lanes start to collapse. I'm not sure what's happening here. The code is posted below and I'm using a simple form of collision detection, but I've also implemented a circle to circle sweep function that I found on gamedev, and that did the same thing at the code below. After running the code, press 'A' to add 10 circles. They will move to the right of the screen and stop near the end. This is where they should accumulate. After adding about 300, they lanes start to collapse. Can anyone find what's wrong with this? It's made with Allegro, but that's not the part that's not working. #include <stdio.h> #include <stdlib.h> #include <allegro.h> #include <winalleg.h> #include <list> #include <cmath> using namespace std; class Circ { public: double m_x, m_y, m_size; }; BITMAP *buffer = 0; int last_clock_tick = 0; int delta_clock = 0; int clock_ticks = 0; char ons = 0; double speed = 150.0; list<Circ> CList; double Collision( Circ *c ) { list<Circ>::iterator index; Circ *p; double l1, l2, res; double dx, dy; for ( index = CList.begin(); index != CList.end(); ++index ) { p = &(*index); if ( p != c ) { dx = ( p->m_x - c->m_x ); dy = ( p->m_y - c->m_y ); l1 = ( dx * dx ) + ( dy * dy ); l2 = p->m_size + c->m_size; if ( l1 < ( l2 * l2 ) ) //Collision { res = ( l2 - sqrt(l1) ); return res; } } } return 0; } void UpdateCircles( int milliseconds ) { list<Circ>::iterator index; Circ *p; double spd, res; for ( index = CList.begin(); index != CList.end(); ++index ) { p = &(*index); spd = speed * ( (double)milliseconds / 1000.0 ); if ( p->m_x < 635.0 ) p->m_x += spd; res = Collision( p ); if ( res > 0 ) p->m_x -= ( res + 0.1 ); } } void DrawCircles( BITMAP *dest ) { list<Circ>::iterator index; Circ *p; for ( index = CList.begin(); index != CList.end(); ++index ) { p = &(*index); circlefill( dest, p->m_x, p->m_y, p->m_size, makecol( 255, 0, 0 ) ); } } void AddCircle( double x, double y, double size ) { Circ p; p.m_x = x; p.m_y = y; p.m_size = size; CList.push_back( p ); } char Init() { if (allegro_init() != 0) return 1; install_timer(); install_keyboard(); set_color_depth( 32 ); if (set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0) != 0) { set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); allegro_message("Unable to set any graphic mode\n%s\n", allegro_error); return 1; } /* allocate the memory buffer */ buffer = create_bitmap(SCREEN_W, SCREEN_H); return 0; } void Destroy() { if ( buffer ) destroy_bitmap( buffer ); allegro_exit(); } int main(void) { //Initialize the application if ( Init() ) { Destroy(); return -1; } last_clock_tick = GetTickCount(); //Press ESCAPE to get out while( !key[ KEY_ESC ] ) { clock_ticks = GetTickCount(); delta_clock = clock_ticks - last_clock_tick; last_clock_tick = clock_ticks; if ( key[ KEY_A ] && ons == 0 ) { AddCircle( 50, 120, 5 ); AddCircle( 50, 140, 5 ); AddCircle( 50, 160, 5 ); AddCircle( 50, 180, 5 ); AddCircle( 50, 200, 5 ); AddCircle( 50, 220, 5 ); AddCircle( 50, 240, 5 ); AddCircle( 50, 260, 5 ); AddCircle( 50, 280, 5 ); AddCircle( 50, 300, 5 ); ons = 1; } if ( !key[ KEY_A ] ) ons = 0; UpdateCircles( delta_clock ); DrawCircles( buffer ); textprintf( buffer, font, 10, 10, makecol( 255, 255, 255 ), "Circles = %d", CList.size() ); //Flip the double buffer blit( buffer, screen, 0, 0, 0, 0, buffer->w, buffer->h ); clear_bitmap( buffer ); } Destroy(); return 0; } END_OF_MAIN() Thanks, Brain21 [Edited by - brain21 on December 7, 2008 12:18:01 AM]
  5. Want to start on phone

    Ok, thanks, I'll have to look into these. I don't have a phone right now, so I'll have to get a cheap one. I have an old blackberry, but I don't think IT would let me load my own stuff on there. Thanks again! Brain21
  6. Hi, I'd like to start programming for phones. Are there many different types of OS's for phones? Do I have to pick one and go with it or is there a form of flash for phone games that I can use to code for multiple phones? Also, is it possible to get to the camera on a phone so I can make games that need you to take pictures like picture books or stuff like that? And what about the video capability of the phone? If it has some, can I access that through coding? Is there a website out there for begginers to this? Brain21
  7. Open Source Editor

    Ok, I'll try Blender. It looks good.
  8. Open Source Editor

    I'll try out the Horde editor and see. I'm trying to make a virtual machine sim for work. The reason I need the editor to be customizable is that I want to create simple shapes (cubes, prizms, ect) and then be able to add custom data to each one like weight, strength, friction. Then click a button and see the simulation. The sim would interface to an external computer (PLC) that would control the machine.
  9. Open Source Editor

    I found one called "Scythe Physics Editor" that might work. Also I found out that Blender3d can be modified for my needs. Thanks.
  10. Open Source Editor

    so there's nothing I can start out with? I have to code the editor myself? There must be an easier way. I guess I better look into doing it myself
  11. Open Source Editor

    I guess I'm looking for an already made viewport/toolbar/menu system that can be added to to make your own editor. Like a starting point for my own editor. I want to concentrate mostly on the simulation and not the editor. This editor should handle mouse clicks/drags and keyboard. stuff like that. have tabs for menus. A starting point I guess. [edit] Like a 3d editor that I can customize to my needs.
  12. Open Source Editor

    Can I modify the editors for my needs with these? I'll check them out.
  13. Collision type

    Hi, I'm playing with ODE. I was wondering how do I tell it to do this: if a box collides with the floor, use this kind of collision point if a box collides with another box, use another kind of collision point. By collision point, I mean the values you define when something collides like bouncyness and friction. Brain21
  14. Hi, I'm looking to make a simulator. I'm working on the simulator part now, but I was wondering if there are any 3d editor programs that are open source and are made to be customize to my needs. Sort of like a starter base code. Something that looks like Max3d or the sort. I've tried googling around, but I keep getting free 3d editors (modeling). Brain21.
  15. Video to Image

    I did try that. I don't know how I missed it! Most of the ones I've tried can save one screenshot, but not all of them to file. Thanks!