If you see my other question, you'll know that I'm starting to try making simple 2d games on mac. There I was deciding which library to use (OpenGL or Quartz), but no matter what I'll have to use Cocoa to make it a nice Mac application, and for the window and the view (with OpenGL, NSOpenGLView). Obviously for a game, the view will have ...
I'm designing a collision detection game tutorial for young adults, so I want this to be as simple as possible to make it easier to explain.
The requirements are very simple. The world is 2D and contains only rectangles (of arbitrary sizes). BSP and even quadtrees seems like it would be overkill (again, the emphasis is on simplicity) bu...
Hi guys
I'm trying to make a circle across a plane using sin and cos. While it works all well when its aligned with the x, y, or z axis, I need something more dynamic. Is there any way to transform a 2D vector to a 3D one using a plane normal, or perhaps another solution?
Thanks in advanced.
...
So I'm trying to figure out how to implement a method of selecting lines or edges in a drawing area but my math is a bit lacking. This is what I got so far:
A collection of lines, each line has two end points (one to start and one to end the line)
The lines are drawn correctly on a canvas
Mouse clicks events are received when clicking ...
Hi All,
How can I draw a perpendicular on a line segment from a given point? My line segment is defined as (x1, y1), (x2, y2), If I draw a perpendicular from a point (x3,y3) and it meets to line on point (x4,y4). I want to find out this (x4,y4).
Thankx.
...
Hi All,
I am trying to check the location of a point(px, py) on 2D graph in relation to a line segment (lx1, ly1) (lx2, ly2), using logic of North South East West directions. The logic I have implemented is to draw a perpendicular on the line segment from the point.
if perpendicular is on line that means its south.
If point on right...
I've got some free time coming up over the holidays and am finally going to get around to building/prototyping a video game I've been building in my head for a few years. Now I'm just looking for a game engine that is:
Free
Nice API
Easy to extend
The language doesn't really matter. This is really a prototype and I'm comfortable lea...
Hi,
I was wondering if there was a way to make OpenGL ES render a batch of quads (rendered with texture page changes) and render them in z order (or reverse).
Note I don't want a ZBuffer, I just want quads rendered in order of zDepth.
Now I know people will say just render them in order, well I render grouped by texture page. However ...
How do you make a graph in networkx such that its layout is 2D, radial, and the edges are plotted in increasing edge lengths or weights?
...
I have a problem with circle-circle collision detection.I used the following algorithm
func collision(id,other.id)
{
var vaP1,vaP2,dis,va1,vb1,va2,vb2,vp1,vp2,dx,dy,dt;
if (id!=other.id)
{
dx=other.x-x;
dy=other.y-y;
dis=sqrt(sqr(dx)+sqr(dy));
if dis<=radius+other.radius
{
/...
Are there methods for evaluating cubic or quadratic Java2D curves at a given time t? I know the algorithm is simple, but I would suspect that there is a method for that already in Java.
...
I have 2 points in X,Y + Rotation and I need to calculate a bezier spline (a collection of quadratic beziers) that connects these 2 points smoothly. (see pic) The point represents a unit in a game which can only rotate slowly. So to get from point A to B, it has to take a long path. The attached picture shows quite an exaggeratedly curv...
The thing is I have to create a 2D matrix in php where each row and column must have a key. I tried to do this but what happens is that a 2-D array is created which does not resemble a matrix. I used the following code:
$x=$row['start_id'];
$y=$row['dest_id'];
$d=$row['distance'];
$this->map[$x][$y]=$d;
Here map is the intended matri...
Hey, everyone. I'm new to Java and I have 2D LinkedList like this:
LinkedList<LinkedList<String>> albums = new LinkedList<LinkedList<String>>();
Which is filled with data like so:
if (!artist.isEmpty() && !name.isEmpty()) {
albums.add(new LinkedList<String>());
albums.getLast().add(artist.toString());
albums.getLast()...
Hi,
I have a set K of randomly selected pixels in a 2D image. For every other pixel in the image I need to find out which pixel in set K is closest to it (using the standard sqrt(dx^2 + dy^2) measure of distance). I am aware that there may be more than one solution for each pixel. Obviously it can be done by brute force against every pi...
I'm trying to write a 2D simulation of a ball that bounces off of fixed vertical and horizontal walls. Simulating collisions with the faces of the walls was pretty simple--just negate the X-velocity for a vertical wall or the Y-velocity for a horizontal wall. The problem is that the ball can also collide with the corners of the walls, ...
I am writing simple hex engine for action-rpg in XNA 3.1. I want to light ground near hero and torches just as they were lighted in Diablo II. I though the best way to do so was to calculate field-of-view, hide any tiles and their's content that player can't see and draw special "Light" texture on top of any light source: Texture that is...
Hello !
Could you please point me to a good C# tutorial for drawing 2d graphics like Ellipse and Rectangle (that inherit from Shape) on a Canvas using WPF ?
I'm also interested later to click on shapes and identify which shape was clicked, and also to drag and drop shapes on the canvas.
Thank you !
...
I'd like to include a simple draw feature on my app. A friend told me I can't use canvas because I need to control the frame buffer and not redraw the entire screen every for every frame. He suggested I find a openGL 2d engine. I've searched around and I've only found Rokon which doesn't have any documentation and the examples aren't qui...
Hello,
I'm making a side scroller similar to Castle Crashers and right now I'm using SAT for collision detection. That works great, but I want to simulate level "depth" by allowing objects to move up and down on the screen, basically along a z-axis (like this screenshot http://favoniangamers.files.wordpress.com/2009/07/castle-crashers-...