Questions tagged [2d]

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

2d
2,344 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
0 answers
2k views

tcpdf generate pdf417 2D barcode can't set width

I try to generate the barcode with these requirements: Barcode Type: PDF 417 Error Correction Length: 5 ...
wazzup's user avatar
  • 21
2 votes
1 answer
109 views

How to use structs with 2D Arrays and Dynamic Memory Allocation

I am having trouble figuring out how to get the same results as the following code, but with a struct. My goal is to create a dynamically allocated 2D Array initilialized to all zeroes by using the ...
Angel Zermeno's user avatar
2 votes
1 answer
71 views

Move view when screen is touched

I have a Button, and when the user touches it I want the Button to start moving. Move a button (with fixed speed) on a relative layout after the screen has been touched I tried to use a thread to ...
Fundhor's user avatar
  • 3,499
2 votes
0 answers
83 views

Y axis down and fliped scene2d elements

In my app I use orthographic projection with reversed y axis, as suggested in Changing the Coordinate System in LibGDX (Java) It works fine - I know how to draw fonts, textures and so on. Recently I ...
Bartek's user avatar
  • 73
2 votes
0 answers
375 views

How to construct 3D image from 2D image using Markov Random Field?

I have one 2D CT image and I want to convert it to 3D image using Markov Random Field. There are several papers in the literature in which this technique was used based on 3 2D orthogonal images. ...
Dania's user avatar
  • 1,658
2 votes
0 answers
568 views

Draw 2D line with vector and start point

I am making a 2D game with java GUI. I have basic lights using this algorithm http://ncase.me/sight-and-light/ . I cast rays and get the closeset hit point. My problem is that i check each ray with ...
Nikolai Nikolov's user avatar
2 votes
1 answer
93 views

Placing a circle so that it does not collide with any other circles

Given a canvas with a bunch of circles with a certain radius, say 50, how do I place another circle with radius 10 in a random location so that it does not collide or overlap with any existing circles?...
user3130915's user avatar
2 votes
1 answer
112 views

Java/Slick2D Camera not following character

For some reason when i make my map bigger then 15 x 25 the camera gets all buggy, at the top part of the map the camera jumps showing the bottom of the map, and at the bottom it jumps to the top. ...
Alexander Smith-Richard's user avatar
2 votes
0 answers
964 views

LibGDX PolygonSprite vs PolygonRegion

I can use both with the PolygonSpriteBatch to print a Polygon, ie: Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888); pixmap.setColor(0x00CC00FF); // DE is red, AD is green and BE is blue. ...
Korb's user avatar
  • 33
2 votes
1 answer
629 views

How to parse json object in UnityScript?

I am following this link http://wiki.unity3d.com/index.php/JSONUtils but not able to parse json object. What I have tried so far: function SerializeObject() { var object = {"response":[{"id":"...
DKBHOI's user avatar
  • 348
2 votes
0 answers
361 views

2d perspective skew in JS

I want to transform an image in 2 points perspective. I guess I need to transfer to JS a formula from: http://web.iitd.ac.in/~hegde/cad/lecture/L9_persproj.pdf But I'm humanities-minded person and I ...
Sergey Kritskiy's user avatar
2 votes
1 answer
3k views

OpenGL Rendering 2D in a 3D space

Am currently working on a project as part of my coursework and realised I needed to have a HUD to display information to the user, stumbled upon glOrtho and have been trying to use it however am ...
Cosmin S's user avatar
2 votes
0 answers
61 views

JAVASCRIPT 2D Platformer objects do not appear on screen

I have been coding with javascript for about 3 months now and I decided to start working on a 2D Platform game for my Advanced Higher project. I found a very helpful tutorial online which showed each ...
Mark Barton's user avatar
2 votes
1 answer
311 views

How to correlate 2D mask with noisy image?

I have a matrix 'A' with two columns which contains 2D points ( coordinates 'x' and 'y'). These points earlier were projected onto the plane from 3d cloud, so they create a 2d shape of some object. ...
Bartrvn's user avatar
  • 43
2 votes
1 answer
2k views

Fast method to rasterize triangle in python

In python I want to rasterize a 2D triangle from a 3D triangle as fast as possible and clip the pixels that are out of the z bounds. I can convert 3D coordinates to 2D, I just can't seem to get the ...
user3116196's user avatar
2 votes
1 answer
1k views

Calculating relative item positions based on camera position and rotation

For a 2d game, I have these concepts: stage: container in which items and cameras are placed. item: a visible entity, located on a certain point in the world, anchored from center. camera: an ...
jsnoob's user avatar
  • 73
2 votes
1 answer
221 views

Stop camera from view going past background

I've made my camera a child of the player but how do I stop the camera view going past the a background? I want to stop the blue bit from showing. My camera is orthographic. I tried this function ...
user3053151's user avatar
2 votes
1 answer
3k views

Photon 2d game multiplayer lags

I have a 2D multiplayer game using Photon where all the movements are made by RigidBody 2d. When both players are connected I can see my opponent movements but they are not smooth. Last Update Time ...
NovaSurfer's user avatar
2 votes
0 answers
215 views

mongodb slow query with $near and other condition

I have a mongodb collection named rooms, and it has a 2d index for field location. I've queried like this: db.rooms.find( { "location" : { "$near" : { "latitude" : 37.3356135, "longitude" : 127....
youngrok's user avatar
  • 132
2 votes
0 answers
301 views

Slick2D Alpha Lighting Issues

I'm writing an Alpha Map Lighting system, and I've been successful to some degree. Here is my code: g.clearAlphaMap(); g.setDrawMode(Graphics.MODE_ALPHA_MAP); GL11.glEnable(SGL.GL_BLEND); GL11....
Quinn Finney's user avatar
2 votes
1 answer
343 views

How to draw 10000+ 2d graphical objects quickly?

I need to draw tens of thousands, in the future probably hundreds of thousands of simple 2d objects (circles, rectangles, some filled, labeled...) to a widget. In the same program I need GUI widgets (...
steffen's user avatar
  • 8,810
2 votes
0 answers
730 views

Directional collision detection between two rectangles

So I need some help with my C# XNA top-down 2D "wave spawn" game. Basically, I have a player that has the functionality of shooting a laser at enemies that spawn in waves. The problem that I'm looking ...
user3138251's user avatar
2 votes
1 answer
220 views

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, ...
ben's user avatar
  • 133
2 votes
1 answer
1k views

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 ...
Kwibble's user avatar
  • 45
2 votes
0 answers
152 views

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 ...
Vladimir Gazbarov's user avatar
2 votes
0 answers
286 views

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....
Suzan Cioc's user avatar
  • 29.7k
2 votes
1 answer
149 views

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 ...
Tom's user avatar
  • 830
2 votes
1 answer
214 views

Check collision 2D game, image/control?

i'm developping a 2D Game for Windows Phone, for now i have a Xml parser that i used to config maps and draw items. Maps are farms. My question is : Once i have all my items drawn, i d like to check ...
Gabson's user avatar
  • 431
2 votes
0 answers
141 views

Garbage collection pauses; Javascript

I've been working on creating a basic 2D tiled game and have been unable to pinpoint the source of noticeable pauses lasting ~100-200ms every second or two, but it seems like GC pauses as when I ...
James Crepin's user avatar
2 votes
1 answer
435 views

Supporting 2D rendering in Windows Phone 8

How can i render text, paths, squares-ovals-other-2d-geometry into memory (bitmap, byte*) in Windows Phone 8 in C++. This bitmap subsequently will be sent to DX3D11. In other words - an analogue of ...
mjollneer's user avatar
  • 1,035
2 votes
2 answers
649 views

Loading a subimage from a tile map

I'm trying to develop my first game. I have serious issues with loading Tiles extracted from a map. Here's what I've coded so far, just willing to display the first tile. public class TileMap { /...
user avatar
2 votes
0 answers
238 views

Android 2D Graphics are Choppy

SurfaceView.LockCanvas() is taking anywhere from 15ms to 75ms to complete. Is there any way to fix this, or to make it less sporadic? Background: I am new to Android 2d graphics development, so I ...
Design.Garden's user avatar
2 votes
2 answers
77 views

C# 2DGraphics.Transform

hope anyone can help with this question even my english is poor. Im drawing lets say a square on the screen with a Graphics that has a transform and that works just fine but the user should be allowed ...
user1509662's user avatar
2 votes
2 answers
303 views

Depth sorting of elements drawn on the screen

I have small program here in which I am drawing some elements on the window. class CustomPointer{ void draw(); //draw png image on the screen }; class CustomRectangle{ void draw(){ drawRect(); //...
Cipher's user avatar
  • 5,992
2 votes
0 answers
1k views

Method Color(int RGB) seems to be unknown

public class Object2D /** * A TwoD_Object contains two ints resembling its width and height, * and a Color-Array constructed by them. That Array, contains the * information about every possible ...
Jonas Bartkowski's user avatar
2 votes
1 answer
267 views

How to drag a single card

Hi im making a solitaire game. Now i show all my cards 13 by 4 on screen. I can drag the cards but somehow the whole row from top to down is selected. And if i move the drag to the left or right it ...
MrP's user avatar
  • 21
2 votes
1 answer
347 views

rotating a rocket in 2D space and allowing it to move in direction its facing, lua, corona

im new to both Lua and corona and have been trying to get my game to lift off(pun intended) i essentially want to rotate my rocket both clockwise and anti clock wise and have its x and y adjusted in ...
Krisdom's user avatar
  • 25
2 votes
1 answer
2k views

Mpi Scatter dynamical allocated 2d array(pgm file image)

I have implemented a 2d array Mpi scatter which works well. I mean that the master processor can scatter 2d parts of the initial big array. The problem is when I use as input the 2d image file ...
Mike B's user avatar
  • 1,522
2 votes
1 answer
949 views

mongodb/rails "exception: can't find special index: 2d for:"

i have a rails app where i have some problems with indexes. I search locations by name. First i thought its a problem with the addresses.coords but iam not sure about it. The relevant parts of the ...
user1800569's user avatar
2 votes
2 answers
370 views

Basic Pygame Program Not Executing

Typed in this pygame code for an animation test, I was expecting some errors, but the program simply won't execute: First part imports modules import sys import os import pygame from pygame.locals ...
user1792990's user avatar
2 votes
2 answers
662 views

How to get the contents of a column to slide down to the bottom row of my 7x7 2D array?

I've been lurking and found heaps of great information form here, however the last few days I have been stuck and haven't been able to find help with my issue so I thought id post. I have some ...
Enigma's user avatar
  • 21
2 votes
2 answers
2k views

Alternative to glRotatef and glutBitmapCharacter?

This is what my code is currently. However, for the life of me I cannot get the text to rotate. Do I need to use something other than glutBitmapCharacter? Just to clarify, this is only a 2D program ...
Ankit Ahuja's user avatar
2 votes
0 answers
590 views

HTML5 Canvas line anti aliasing inconsistency

I have a situation where anti-aliasing is not perfect under Chrome and Firefox, but perfect in Internet Explorer 9. The code, simplified is: ctx.scale(zoom, zoom); for (var i = 0; i <= 100; i++){ ...
Jodes's user avatar
  • 14.4k
2 votes
0 answers
1k views

Maximum Number of Rectangles to Fit in An Area [Competition , Not HW]

I have had this category of problems before, but never been able to solve it. The problem statement this time being : There are a given number of rectangles (different dimensions, given) , and a ...
Kyuubi's user avatar
  • 1,228
2 votes
1 answer
1k views

Android Opengl Graphical Glitch

Using Opengl 2.0 on android I am trying to create a class to help me draw square sprites from a texture atlas. I'm getting some weird graphical glitches(sometimes lines/ squares missing form textures),...
Kieren Anderson's user avatar
2 votes
1 answer
1k views

Tiled map and sprites : am I doing it the right way?

I'm developing an old-fashioned 2D RPG with Python + pyglet. The map is made of several layers (up to 10), each of them consituted of squared tiles (32x32 pixels). The sprites (party characters, NPC, ...
Fred's user avatar
  • 901
2 votes
0 answers
520 views

How to handle sprites more than 200 with SpriteList of Playstation Mobile SDK?

I am working on 2D shooter game which includes hundreds of bullets and implemented a simple test based on PlayStation mobile SDK tutorial, and slowing down of the frame rate is my main problem. Scene ...
Walker's user avatar
  • 23
2 votes
0 answers
1k views

Drawing Isometric game world with rotated objects

Drawing isometric world, where objects are not rotated is quite straightforward and is discussed here: Drawing Isometric game worlds Simple method, is to take ground collision rectangle of every ...
kovarex's user avatar
  • 1,800
2 votes
1 answer
2k views

coding 2D game physics in javascript, not-flat ground and rotation

I have a small project in my webprogramming course where I am supposed to make a small game in javascript. This is the game: two cannons are fixed on opposing ends of the game space. The cannons take ...
Lurifaxel's user avatar
  • 714
2 votes
0 answers
352 views

Mapping function from 2D to 1D

I have 2D elements distributed in a space of [-4, +4] and want to convert any point in the 2D space to a 1D real-valued number such that 1st quadrant [+, +] should have higher values (importance), 2nd ...
Code Warrior's user avatar

1 2
3
4 5
47