2d

Large scrolling background in OpenGL ES

Hello! I am working on a 2D scrolling game for iPhone. I have a large image background, say 480×6000 pixels, of only a part is visible (exactly one screen’s worth, 480×320 pixels). What is the best way to get such a background on the screen? Currently I have the background split into several textures (to get around the maximum texture s...

Drawing an iso line of a 2D implicit scalar field

I have an implicit scalar field defined in 2D, for every point in 2D I can make it compute an exact scalar value but its a somewhat complex computation. I would like to draw an iso-line of that surface, say the line of the '0' value. The function itself is continuous but the '0' iso-line can have multiple continuous instances and it is n...

How to determine path from noisy X, Y data

I have an unsorted list of noisy X, Y points. They do, however, form a path through the world. I would like an algorithm to draw an approximation of this data using line segments. This is similar to how you would use a line -fitting algorithm to pick an approximation of linear data. My problem is only harder because the path bends and w...

Random points inside a Polygon

I have a 4 side convex Polygon defined by 4 points in 2D, and I want to be able to generate random points inside it. If it really simplifies the problem, I can limit the polygon to a parallelogram, but a more general answer is prefered. Generating random points until one is inside the polygon wouldn't work because it's really unpredict...

Calculating a 2D Vector's Cross Product

From wikipedia: the cross product is a binary operation on two vectors in a three-dimensional Euclidean space that results in another vector which is perpendicular to the plane containing the two input vectors. Given that the definition requires at least three dimensions, how does one calculate the cross product of two 2d vectors?...

Accelerate 2D images in Java *without* disturbing JMenus

Already implemented performance boosters : - Get compatible image of GraphicsConfiguration to draw on - Enable OpenGL pipeline in 1.5: Not possible due to severe artifacts So far I am fine, the main profiled bottleneck of the program is drawing an image with several thousand tiles. Unfortunately it is not regular, else I simply could se...

How to produce Photoshop stroke effect?

I'm looking for a way to programmatically recreate the following effect: Give an input image: I want to iteratively apply the "stroke" effect. The first step looks like this: The second step like this: And so on. I assume this will involves some kind of edge detection and then tracing the edge somehow. Is there a known algorithm ...

How to divide an area composed of small squares into bigger rectangles?

Where would i go to look for algorithms that take a 2d grid of values that are either 0 or 1 as input and then identifies all possible non-overlapping rectangles in it? In a more practical explanation: I am drawing a grid that is represented by a number of squares, and i wish to find a way to combine as many adjacent squares into rectan...

Recommended Books on Math for Game Development

It's been a few years since my computational geometry class in college, and I unfortunately sold my textbook (Computational Geometry in C), so now that I am writing a 2D video game, I am looking for books to give me a hand. What books are recommended that cover the geometry, math, and physics of 2D video game development? ...

Java 2D Game Frameworks

I have been looking at frameworks for writing 2D games in Java - part of a growing desire to rediscover my roots in writing those simple but addictive video games. I have googled and found some possibilities, but it's hard to judge which is best without investing significant time in each. Does anyone out there have any recommendations ...

gpu, old hardware, 3d acceleration and a lib

i am writing a 2d lib which will have 3d acceleration but i'd like to do it in a way that it will efficiently run on older HW. Possibly typedefs to hide options/functions that your targeted mode does not support. (also there may be emulation func turned on) What are some of the things older HW do? here is a list of questions and things ...

What's the best way of reading a sprite sheet in Java?

I'm writing a basic sprite engine for my own amusement and to get better aquainted with Java's 2d API. Currently I am making use of large numbers of separate .png files with transparent backgrounds to represent the various sprites and different frames of animation that I need. Most 'real world' game development projects seem to make use ...

Finding closest non-black pixel in an image fast

I have a 2D image randomly and sparsely scattered with pixels. given a point on the image, I need to find the distance to the closest pixel that is not in the background color (black). What is the fastest way to do this? The only method I could come up with is building a kd-tree for the pixels. but I would really want to avoid such ex...

3D effects in a 2D game using OpenGL

Hello! I am working on a 2D game using OpenGL ES. I am using the orthographic projection, since it makes the 2D stuff easy. Now I would like to create a simple 3D effect, say rotate a sprite around the Y axis (something like cover flow). If I understand things correctly, this can’t be done in the ortho projection. Is it possible to do it...

What is the best 2D graphics library for Windows Mobile?

The title speaks for itself... I've tried to find another question like it but must have missed it if it exists. I'm looking for anything, from a core library replacing GAPI to a .net wrapper... It's for building a nice UI so no 3D needed... ...

Good algorithm for drawing solid 2-dimensional polygons?

What is the simplest (and easiest, although that's subjective) algorithm for drawing solid (as in a single, solid color--no texture mapping) 2D polygons in memory? What is the most efficient method? I am not interested in using the GPU or any rendering method, as the output of my program will not be to the screen. ...

Correct way to handle 2D z-indexing in a 3D scene (DirectX)

I need to achieve the following: Two 2D quads appear as though they are stacked one on top of the other (like two halves of the same texture) but are in fact seperated on the z axis by n coordinates. So that if a 3D object passes between them one half appears in front of the object and the other behind. Could i achieve this by applying...

How to decode U.P.S. Information from UPS MaxiCode Barcode?

I recently purchased a 2D Barcode reader. When scanning a U.P.S. barcode, I get about half of the information I want, and about half of it looks to be encrypted in some way. I have heard there is a UPS DLL. Example - Everything in bold seems to be encrypted, while the non-bold text contains valuable, legitimate data. [)>01961163522424...

Does anyone know of any good tutorials for the Slick 2D lib?

There is a 2D java graphics library called Slick 2D (http://slick.cokeandcode.com/) that seems to be used by a bunch of indie games (mostly applets), but the documentation is a little lacking. Does anyone know of any good tutorials for this lib? ...

Are there any free tools to create SWF / Flash animations?

Are there any competitor tools like Flash for creating SWF animations? My 8 year old son wants to learn 2D animation but I doubt his anticipated attention span warrants buying Flash. ...