pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing
pyTile Iso depth sorting

pyTile Iso depth sorting

Timothy Baldock (entropy)

Tags:

Description

This is going to be a testing demonstration of a sprite depth sorting system I'm working on. Currently it takes a coordinate in 3D space and draws a bounding box around it based on a projection.

The idea is that objects will be represented in 3D based on a coordinate, 3 dimensions, a rotation and a tilt (to allow for tilting up/down for going up/down hills).

The sorting works by finding how close each object is to a plane passing through the 3D space origin, such that a viewing ray from the camera is a normal to that plane. This is used to compare objects and determine if one is in front of another. A simple heap-sort is then used to keep all the sprites in order. Eventually all of this behaviour will be implemented in a sprite group class and used in my game project pyTile.

Controls:
Q/D - position in X
A/E - position in Y
W/S - position in Z
U/L - size in X
O/J - size in Y
I/K - size in Z
Z/X - rotation
UP/DOWN/LEFT/RIGHT - Move origin in 2D
T/Y - toggle origin/coordinate display

Links

Home Page: http://entropy.me.uk/pytile/

Pygame.org account Comments

If you wish to leave a comment with your pygame.org account, please sign in first.

No user comments have been submitted.
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Oct 28, 2014

Oct 21, 2014

Oct 20, 2014

Oct 16, 2014

Oct 9, 2014

Oct 8, 2014

Oct 7, 2014

Oct 4, 2014

Oct 1, 2014

Sep 19, 2014

Sep 17, 2014

Sep 9, 2014

... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)