# Troubles in isometric space...

This topic is 2970 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello,

I am working on a 2D isometric game (my first isometric game!), but unfortunately I am stuck, so I hope some people here could enlighten me.

My main trouble is related to how I project the camera view area into my grids plane (defined in x-z plane). Currently I am doing it as follows:

1. I define my view area in the X-Y Plane (aka screen), I move the camera around using this view area.

2. To find the visible area on my grid, I project the 4 corners of my view area to isometric space (x-z plane) and compute a axis aligned bounding box from this 4 points.

3. This projected area (the AABB in x-z plane) is what I use to for intersections test against my entities / tiles rectangles (also in x-z plane).

This approach works fine ONLY if my objects have a height == 0 (on plane), if I test this area against a entity with a height of 64 (to say something), it miss it at some places, mostly at the corners.

I guess this trouble is related to how I manage my objects with a height > 0,
I just sets its bounding box size to be the radius of the entity, much like

vector max = new vector(entity_width, entity_height, entity_length);
float radius = max.length() * 0.5;

Oscar

##### Share on other sites
This sounds simply like your frustrum-culling is looking only at the ground plane, and expecting your objects to exist at ground level.

If you have a fixed camera angle, then the workaround is simple; objects have to put their view-projected AABB into the view-spatial lookup structure (and probably while keeping their actual AABB in the now-separate world-spatial lookup structure). To avoid two separate spatial lookup structures, maybe you could create for each object a "solid" and "phantom" rectangle, the latter of which is used for view culling, and the former for collision checks.

If you don't have fixed camera angle, then all objects need to update their phantom hit rectangle whenever the camera rotates (around any of the three axes). Because you're using an orthographic projection (you are using an orthographic projection, not just an isometric-like perspective projection, right?), you don't need to update the phantom rectangles when moving the camera as well.

##### Share on other sites
Hey Wyrframe! Thanks for your help, I really appreciate it.

Now, regarding your idea, I liked the "solid" and "phantom" rectangle method, it is elegant and simple to implement, and yes; I am using a fixed camera angle with orthographic projection so it will fit fine in my current code ;)

Best Regards,
Oscar

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5

• 13
• 57
• 11
• 10
• 14
• ### Forum Statistics

• Total Topics
632967
• Total Posts
3009557
• ### Who's Online (See full list)

There are no registered users currently online

×