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
2
votes
2 answers

tkinter is very slow - how to speed it up or use a different library?

I am generating 2D morphogenic plots using tkinter. I find it incredibly slow. For example, this script takes almost 10 seconds on my 8-core Xeon: #!/usr/bin/env python3 import random import tkinter as tk A = 3.419384662527591 B =…
Mark Richman
  • 28,948
  • 25
  • 99
  • 159
2
votes
1 answer

Lighting covering up sky

I have a 2D tile-based lighting system which is drawn onto a Render Target. I am also drawing a background which involves mountains, sun/moon, and clouds. There is also the unlit game; blocks, character, etc. Here is the order in which everything is…
ben
  • 133
  • 13
2
votes
1 answer

Android - 2D Platformer Collision Detection /w Gravity Physics

As this seems to be a recurring topic on 'the stack', I am going to reinforce my problem as something not covered. What has been covered is 2D tile collision for platform games etc., but with the way I have made my game, there are no tiles. I am…
Kwibble
  • 45
  • 7
2
votes
3 answers

Moving a 2d object towards and through a position in Unity 4.3

Trying to get an object to fire towards and through a given position. Like a bullet firing towards the mouse location, I don't want it to stop on the mouse (which is what is happening now). Below is what I have so far, is there a function like lerp…
tylercomp
  • 871
  • 3
  • 13
  • 25
2
votes
0 answers

OpenGL-ES - correct approach to rendering a 2D game

I am making an Android game with 2D graphics, and I need an advice to how to correctly render it to get good performance. Currently the performance is really bad. Furthermore I want to know how to correctly move to using VBOs for rendering many…
Vladimir Gazbarov
  • 860
  • 1
  • 10
  • 25
2
votes
1 answer

2D projectile trajectory prediction (unity3d)

(Using unity3d 4.3 2d, it uses box2d like physics). I have problems with predicting trajectory I'm using: Vector2 startPos; float power = 10.0f; float interval = 1/30.0f; GameObject[] ind; void Start (){ transform.rigidbody2D.isKinematic…
skakac
  • 23
  • 1
  • 4
2
votes
2 answers

Null pointer exception despite done right

I recently was coding but encountered an null pointer exception the stack trace says Exception in thread "main" java.lang.NullPointerException at com.masterkgames.twisteddream.level.SpawnLevel.generateLevel(SpawnLevel.java:34) at…
2
votes
2 answers

Maximum covering of a polygon with fixed, give size identical squares

I would like to know a few things about the algorithm for the following problem: Given a matrix with 0s and 1s and the size of a square, what is the maximum number of adjacent squares for covering the 1s and what is their position? In case there are…
2
votes
1 answer

How do I implement a 2D transformation matrix?

I would like to make a 2D game engine which is heavily focused on vectors. I would also like use a transformation matrix to translate, rotate and scale sprites that I would like to load in somehow. I'm trying to do this without an external library…
Sam Walls
  • 185
  • 1
  • 4
  • 12
2
votes
0 answers

Any Java graphics library library with NURBS, homogeneous coordinates and perspective?

Are there any Java graphics libraries which support NURBS, homogeneous coordinates and perspective transform? I need 2D. Better if this library will be an extension of something standard like java.awt.geom.
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
2
votes
3 answers

2D (or 3D) Graphics Programming using Windows API with C++?

I am about to start my project for a university course unit. I am looking to make something a bit like asteroids, the retro 2D game, in c++. I could do this using something like SFML, which would certainly seem to be the logical thing to do. However…
FreelanceConsultant
  • 13,167
  • 27
  • 115
  • 225
2
votes
1 answer

Rendering rotated rectangles from box2dweb in pixi.js

I am writing my own renderer for box2dweb and I decided I would like to use pixi.js. I am able to render rectangles, but only if they aren't rotated - if they are, the animation is messed up. It looks like this (one on the left is debug renderer…
Nebril
  • 3,153
  • 1
  • 33
  • 50
2
votes
1 answer

Pygame camera follow in a 2d tile game

import pygame, sys from pygame.locals import * pygame.init() size = width, height = 480,320 screen = pygame.display.set_mode(size) r = 0 bif = pygame.image.load("map5.png") pygame.display.set_caption("Pygame 2D RPG !") x,y=0,0 movex,…
user2301893
2
votes
2 answers

Screen coordinates to isometric coordinates

I'm struggling at converting mouse/screen coordinates to isometric tile index. I have tried about every formula I could find here or on internet but none of them seems to work or I am missing something. Here is a picture, origin is in the top left…
Hnus
  • 912
  • 2
  • 9
  • 24
2
votes
1 answer

How to do Photoshop blending emboss etc in Java2D

This feature exists in Photoshop CS2: take a layer that has some transparency, and create a layer that will blend with it to provide effects like 'emboss' and 'inner or outer glow'. I'd like to know how to achieve similar effects in Java2D. I can…
Tom
  • 830
  • 1
  • 5
  • 13
1 2 3
99
100