2d

HTML5 Tile Engine

What is some good tile engine for the HTML5 <canvas> (for writing 2D games)? ...

Relative performance of native C++ to Flash for pixel-pushing

I was trying to get a ballpark idea of how much slower Flash is at pure pixel-pushing 2D graphics than doing the same thing in SDL or other native library. For instance if I have a Flash/Flex app on a modern PC which each frame does a 2D loop and directly reads/sets every pixel, what equivalent PC would give the same performance for a na...

NSArray as two dimensional array

Hi friends Can anybody suggest which is the best way for using NSArray as two-dimensional array to store data for filtering data based on field. Thanks in advance Regards, sathish ...

Android Opengl 2d Intersection between two graphic objects

Hi, I'm new to opengl and android and couldn't find an answer in the forums so here I am... I need to be able to 'draw' only the intersection of two triangles. I tried to use stencil test but it doesn't work in the android emulator. Then I tried to use depth test and it works but only for a fraction of a second, then the screen goes bl...

Concept for 2D realtime character animation

Hi there, I'm looking for a good concept for realtime character animation in a 2D environment. There several ways, from prepare all the animation stuff offline or do the animation with graphic snippets in realtime. Do you have a good concept for me? Thank you ...

Simulating perspective by rotating an image filled rectangle using 2D transforms

Consider a WPF Rectangle filled with some ImageBrush. Now consider an arbitrary axis through rectangle center. I want to apply a 3D-like rotation around the axis employing only 2D transformations. Basically, I want to achieve perspective with "closer" edge of rectangle to appear larger than the "far" edge which should be visually smaller...

Rotating array differently

hey, I need to rotate a 2d array in such way : 4X4--> Input Output 1 2 3 4 5 1 2 3 5 6 7 8 1 2 6 4 1 2 3 4 5 3 7 8 5 6 7 8 6 7 8 4 or for odd 5X5--> Input Output 1 2 3 4 5 6 1 2 3 4 6 7 8 9 10 1 2 7 8 5 1 2 3 4 5 6 7 3 9 10 6 7 8 9 10 1 8 9 4 5 1 2 3 4 5 2 3 4 5 10 can someone help me? as ...

Box2D b2World in class

So I've got: class bc_Game { public: //blah private: b2World world; }; bc_Game::bc_Game() { //blah, defining variables used world = b2World(gravity, sleep); } Now, I just get error: no matching function for call to 'b2World::b2World()' note: candidates are: b2World::b2World(const b2Vec2&, bool) note: b2World::b2Worl...

Rotated rectangle bounding box size

If I have a given rectangle, with the width w, height h and angle r How large does another rectangle which contains all points of the rotated rectangle need to be? I would need this to perform fast bounding box checks for a 2D physics engine I am making ...

2D orbital physics

I'm working on a 2D physics engine for a game. I have gravity and masses working, using a simple iterative approach (that I know I'll have to upgrade eventually); I can push the masses around manually and watch them move and it all works as I'd expect. Right now I'm trying to set up the game world in advance with a satellite in a simple...

passing a 2 dimensional vector to a function

Hi Guys, How to pass a 2 dimensional Vector to a function in CPP ? I saw the examples for 1 dimension but not for 2 dimensions. If it is passed, is it passed by value or by reference ? vector< vector<int> > matrix1(3, vector<int>(3,0)); //Matrix Declaration. printMatrix(&matrix1); // Function call void printMatrix(vector< vector<int...

2d array of lists in python

Hello, everyone! I am trying to create a 2d matrix so that each cell contains a list of strings. Matrix dimensions are known before the creation and I need to have access to any element from the beginning (not populating a matrix dynamically). => I think some kind of preallocation of space is needed. For example, I would like to have a...

Ellipse fit tangentally to a line modifying one axis

A graphic of this problem is here: http://dl.dropbox.com/u/13390614/Question.jpg Take an axis aligned ellipse with a fixed minor axis, and stretch the ellipse along its major axis till it becomes tangental to some line segment (A in the graphic). What are the coordinates of the tangental point (P), or, what would the major axis l...