The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
29 views

How to find the total bounds rectangle around a list of rectagles

Rectangle object: a simple data structure of 4 floats (w,h,x,y). I have an array of 2 or more rectangles and want to create a rectangle that surrounds all of them: The result rectangle, calculated ...
0
votes
0answers
41 views

Java game 2d rectangle collision [closed]

I've been working on a school-project and I've been working quite hard. The thing is, the collision detection I've been trying does not. :( I am doing all the rendering rendering with ...
2
votes
3answers
71 views

Divide rectangular image into fixed number of random sized rectangles + 1 fixed size rectangle

I'm trying to divide a rectangular image into a fixed number of smaller rectangular image parts (of random but bounded width / height), with the exception of 1 rectangle which is predefined in ...
0
votes
1answer
320 views

Drawing Text on a scene

I am not sure if I am missing something but I was thinking about how text entities are drawn on a scene, are they drawn with an offset depending on the length of the text? I notice that when I add a ...
1
vote
1answer
108 views

What does Rectangle.Intersect means/do?

Ok I have two rectangles one is the ball and other is the paddle. 1. if(ball.rectangle.intersects(paddle.rectangle)) y = -Math.Abs(y); and 2. ...
5
votes
2answers
164 views

Random 2D point in rectangle, but not in a polygon

I have a static rectangle and dynamic polygon. I need to generate a random 2D point in that rectangle, but not in a polygon. This is what I mean: Green is where random point can be generated and ...
1
vote
0answers
158 views

XNA: Placing a “field of view” rectangle on a minimap

I'm building a top-view 3ed person shooter. I have a HUD and in the HUD I have a minimap. I'm trying to draw on this minimap a rectangle which shows me my "visual field", meaning i see on the minimap ...
1
vote
1answer
158 views

How can I make it so that my player object doesn't penetrate world collision when I'm holding down movement keys in that direction?

Right now I have a player object and an obstacle, both with bounding box rectangles around them. The issue is that when my player runs into this obstacle, as long as I'm holding down the movement key, ...
4
votes
1answer
209 views

Creating rectangles from the inner part of a texture2D

Ok, this may be hard to understand, but I'll do my best. You will see that the first image is a normal mario, and the other is the result I am looking for. I'm trying to find a way to extract ...
1
vote
2answers
1k views

Java: Tile-based Collision Detection with Rectangles

There are a few tile-based collision detection questions out there, but none seemed to suit my need. I guess I really would like to know why this method for collision detection isn't working. It ...
6
votes
2answers
360 views

Algorithm to reduce a bitmap mask to a list of rectangles?

Before I go spend an afternoon writing this myself, I thought I'd ask if there was an implementation already available --even just as a reference. The first image is an example of a bitmap mask that I ...
5
votes
2answers
3k views

How to determine collision direction between two rectangles?

I am trying to figure out how to determine the direction a collision occurs between two rectangles. One rectangle does not move. The other rectangle has a velocity in any direction. When a collision ...
2
votes
1answer
462 views

Odd offset bug in Farseer/XNA/C#

So I'm using Farseer to create an immovable object: [...] private Body body; public Immovable(World world, ContentManager c, String s, int posx, int posy, int w, int h, String user_data) { ...
0
votes
0answers
76 views

Any way to optimize testing each bullet for each enemy in shoot em' ups? [duplicate]

Possible Duplicate: Is there a way to increase the collision check efficiency of a system of n objects? Lately I have been making a shoot em' up, and for collision detection I would use ...
1
vote
2answers
786 views

Reference a single 2d Rectangle in an array

What I am attempting to do probably has a very simple answer but I can't make heads or tails of it no matter how hard I try. Provided I'm a newb. What I am trying to do is after I create a grid of ...
0
votes
3answers
4k views

How to rotate a rectangle?

I can easily rotate sprites using the Draw method. However I would like to simply rotate a Rectangle (the structure) so that I can get the coordinate of the four corners of the rectangle. How can I do ...
3
votes
3answers
3k views

Triangle - Rectangle Intersection in 2D

I had previously asked this for 3D but now I changed my strategy and would like to do the intersection in 2D. The Rectangle is axis aligned and will always be in a fixed position, and has a constant ...
3
votes
1answer
939 views

Ray-plane intersection to find the Z of the intersecting point

I have a rectangle in 3d space (p1, p2, p3, p4) and when the mouse rolls over it I need to calculate the exact Z of the point on the rect, given the mouse coordinates (x, y). Would a Ray-plane ...