Questions tagged [2d]

2D computer graphics is the computer-based generation of digital images—mostly from two-dimensional models.

Flat perspective, having no three-dimensional geometry. Including two-dimensional space and 2D geometric models, or two-dimensional images having only height, and width with no depth.

7489 questions
10
votes
2 answers

OpenGL tile rendering: most efficient way?

I am creating a tile-based 2D game as a way of learning basic "modern" OpenGL concepts. I'm using shaders with OpenGL 2.1., and am familiar with the rendering pipeline and how to actually draw geometry on-screen. What I'm wondering is the best way…
naelego
  • 103
  • 1
  • 1
  • 6
10
votes
1 answer

HTML5 - Creating a viewport for canvas

I have a 2D array that is 30 across, 20 down. However, the viewport only paints 15 across and 10 down. I had a game like that originally and I've been trying to achieve something like this: Here's my fiddle: http://jsfiddle.net/sTr7q/
test
  • 17,706
  • 64
  • 171
  • 244
10
votes
1 answer

Can't find suitable example for android 2d opengl sprite class which does not use GL11Ext for drawing

As SpriteMethodTest says there are many ways for drawing sprites. Firstly, I tried canvas, and had some performance problems. Next, I decided to learn opengl. I made my first achievements using GL11Ext extension. However, you know by default, that…
BIOHAZARD
  • 1,937
  • 20
  • 23
10
votes
3 answers

Implementing Pinch and Zoom on Android SurfaceView

I am using a SurfaceView to display a large image (usually bigger than the screen, but not always) in an Android App. This is really trivially simple graphics, and it is easy to implement scrolling using an OnTouchListener or GestureDetector.…
Michael A.
  • 4,163
  • 3
  • 28
  • 47
10
votes
1 answer

Zooming and swiping with OpenGL ES

I am making a 2D puzzle for iOS and currently I`m trying to implement zooming and scrolling with UIPinchGestureRecognizer. Zooming is done this way: I have a target 2D vector which is a "zooming point". The code is: glTranslatef(target.x, target.y,…
riens
  • 101
  • 2
9
votes
1 answer

Wrong rectangle size in canvas

I'm implementing a color picker. There is problem with the rendering. When I call c.fillRect(0, 0, 100, 80); the size of that rectangle is 103x42 px instead of 100x80. What is wrong here? Also, rectangles are antialiased. Do I need offset the…
DraganS
  • 2,621
  • 1
  • 27
  • 40
9
votes
5 answers

Basic pathfinding with obstacle avoidance in a continuous 2D space

I'm writing a simulation in which a creature object should be able to move towards some other arbitrary object in the environment, sliding around obstacles rather than doing any intelligent pathfinding. I'm not trying to have it plan a path -- just…
kpozin
  • 25,691
  • 19
  • 57
  • 76
9
votes
3 answers

OpenGL- Simple 2D clipping/occlusion method?

I'm working on a relatively small 2D (top-view) game demo, using OpenGL for my graphics. It's going for a basic stealth-based angle, and as such with all my enemies I'm drawing a sight arc so the player knows where they are looking. One of my…
Linkage
  • 307
  • 2
  • 6
9
votes
6 answers

What is currently considered the "best" algorithm for 2D point-matching?

I have two lists containing x-y coordinates (of stars). I could also have magnitudes (brightnesses) attached to each star. Now each star has random position jiggles and there can be a few extra or missing points in each image. My question is, "What…
SO Stinks
  • 3,258
  • 4
  • 32
  • 37
9
votes
4 answers

Java slow 2D performance - Resizing

I am using Windows 7 with Aero, and have a very fast graphics card (Radeon 6870) that I use for gaming. I have some issues when resizing very simple programs I make with java. For instance, this program does absolutely nothing. It has no action…
David
  • 15,652
  • 26
  • 115
  • 156
9
votes
2 answers

Is there a 2d physics engine that can model fluids and gases?

At this point the platform and programming language don't matter I would just like to know if something out there exists for this. Any help is appreciated.
Xavier
  • 8,828
  • 13
  • 64
  • 98
9
votes
1 answer

Choosing between Drawing and Shape in WPF

I am not quite sure about the differences between the classes System.Windows.Media.Drawing and System.Windows.Shapes.Shape. They both expose functionality related to 2D graphics in WPF. When would you choose one in your WPF application, and when…
user181813
  • 1,861
  • 6
  • 24
  • 42
9
votes
3 answers

Unity - 2D shader / lighting like Terraria or Starbound

I have a map with a lot of sprites. I could add a material to the sprite with diffuse shading and than add lots of lights. But that won't give me the result I want. And is performance heavy. Examples In the first image you can see that light is…
Derk Jan Speelman
  • 11,291
  • 4
  • 29
  • 45
9
votes
2 answers

Java 2d Games with Java SWING

Me and my friend started developing a game just like Zelda for SNES using Java. The only problem is that we don't know what to use: our very own engine with AWT or if we could use SWING to make it easier. So.. the short question is: For soft java-2d…
Breno Inojosa
  • 602
  • 1
  • 10
  • 20
9
votes
3 answers

2D platformers: why make the physics dependent on the framerate?

"Super Meat Boy" is a difficult platformer that recently came out for PC, requiring exceptional control and pixel-perfect jumping. The physics code in the game is dependent on the framerate, which is locked to 60fps; this means that if your computer…
Archagon
  • 2,470
  • 2
  • 25
  • 38