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
4 answers

Declaration and format of 2D Arrays in Java

I recently got into an argument with a friend about the declaration of multidimensional arrays in Java. It would concern the following type of array: int[][] array = new int[2][3]; So far so good, but one of us sees this array as 2 arrays, each…
Alan
  • 23
  • 2
2
votes
4 answers

Finding 3D coordinate when all 3 coordinates can vary in the object coordinate system

I have the 3D coordinates of 4 coplanar points of my target in the object coordinate system.I also have their the 2D coordinates in every frame of a video.I have also calculated the intrinsic parameters (M) for the camera, the R (rotation) and t…
user2958957
  • 61
  • 1
  • 8
2
votes
1 answer

ActionScript 3 - 2D array for a chessboard

I'm designing a chess game in ActionScript 3 using Flash Professional CC. I've created a chessboard using the IDE and placed pieces in their initial positions. Each tile has its own instance and is named its respective coordinate e.g. the top left…
Manpreet
  • 91
  • 1
  • 11
2
votes
5 answers

Creating GUIs in Win32 C++

I'm developing my first Windows desktop application and I'm trying to figure out what the best approach would be to create the program's GUI. I know, I know... I feel stupid for asking considering the amount of data on the subject on SO. However…
Robbert
  • 5,063
  • 6
  • 36
  • 44
2
votes
1 answer

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 (buttons, text input, checkboxes). I tried Gtk, Qt…
steffen
  • 8,572
  • 11
  • 52
  • 90
2
votes
3 answers

4 Color Gradient using Java awt

I´m trying to create a 4 color gradient to fill a rectangle. Each corner will have a diferent color. The result image I´m trying to achieve is something like…
Abraham
  • 71
  • 1
  • 6
2
votes
3 answers

2D image rotation, few issues

I'm adding "mouse rotation" to my 2D drawing program. I've got all the code working, by basically calculating the rotation angle from the original mouse click to wherever the mouse currently is. I also draw a transparent rectangle that rotates,…
Steven Sproat
  • 4,398
  • 4
  • 27
  • 40
2
votes
2 answers

Works during debug, fails when run?

For some coursework I need to generate a normal magic square through brute force, this is part of the code. fyi; I'm not allowed to use any classes other than the commonly used. (I'm probably pushing my luck with Math.Pow) I have the following…
IamPancakeMan
  • 199
  • 1
  • 10
2
votes
2 answers

OpenGL - How to show the occluded region of a sprite as a silhouette

I'm making a 2D game with OpenGL, using textured quads to display 2D sprites. I'd like to create an effect whereby any character sprite that's partially hidden by a terrain sprite will have the occluded region visible as a solid-colored silhouette,…
whig
  • 23
  • 2
2
votes
3 answers

Improving performance iterating in 2d numpy array

I have two 2d numpy array (images). First one defined by image, is storing the sum of a movement at the pixel (i,j) Second one define by nbCameras, is storing the number of cameras who can see a movement at this pixel (i,j) I want to create a third…
Romanzo Criminale
  • 1,289
  • 2
  • 14
  • 21
2
votes
2 answers

Having trouble with 2D texture movement

I'm having trouble with smooth character movement for a 2d game I'm making. It looks like the character is double when moving. Kinda like this (its just one pixel though): ( () / /{}\ ==> | || The game runs on a solid 60 FPS and my monitor is…
Duckdoom5
  • 716
  • 7
  • 27
2
votes
1 answer

Box2D center of rotation

I use Box2D as phisics engine and QtQuick as visualizer. I setted up simple scene with falling small rectangles and platform to test collisions // the platform block Body { id: block bodyType: Body.Kinematic width:200 …
folibis
  • 12,048
  • 6
  • 54
  • 97
2
votes
3 answers

How do I extract a 2D slice from 3D geometry from plane intersection?

Recently our team was facing the task to build the 2D slice between a plane and some set of 3D geometry (set of triangles). Google hasn't been as helpful as we have wanted it to be, so we turn our attention here to see if anyone has encountered this…
Statement
  • 3,888
  • 3
  • 36
  • 45
2
votes
0 answers

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 at fixing right now is my enemy collision code…
user3138251
  • 67
  • 11
2
votes
1 answer

Link Two Oval In java

I'm tyring to link to circles with drawline , but I have a problem here is my code : import java.awt.Color; import java.awt.FontMetrics; import java.awt.Graphics; import javax.swing.JPanel; public class Panneau extends JPanel { public void…
HinoHara
  • 572
  • 3
  • 13
  • 24
1 2 3
99
100