This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

MatheMagician
MatheMagician presents ...

2013/1/20

z-sorting

This is a demo of using z-sorting to draw 3d worlds. Move using the wasd keys and rotate with the mouse. This scenario uses two coloring methods: one in daylight and one at night where the only light is coming from you. You can toggle between methods by pressing "m". You can also remove blocks by clicking them minecraft style. z-sorting is explained well in this article http://www.flashandmath.com/flashcs4/zsort/. While the article is designed for flash, it does a good job of explaining the technique.

It still needs some work in the way of collision detection, but the 3d is pretty good.

7894 views / 30 in the last 7 days

27 votes | 0 in the last 7 days

Tags: mouse game simulation physics demo with-source 3d

This scenario is a member of: Minecraft-like Games


open in greenfoot
Your browser does not support the canvas tag.
JetLennitJetLennit

2013/3/26

you have GOT to improve on this idea!
JetLennitJetLennit

2013/3/27

this should have waaaaay more votes!
JetLennitJetLennit

2013/4/2

As you said "Ah! That would not be hard: the only difficulty would be in modeling a badguy to chase you." You should make one!
That's basically what my obj file reader is for. I am going to publish a first person shooter using this engine and the obj drawer.
JetLennitJetLennit

2013/4/6

Cool!
MatheMagicianMatheMagician

2013/5/13

Thanks, JetLennit!
DutaDuta

2013/6/8

I remember noticing this ages ago, but I can't remember if I ever commented to say that it's awesome :P If you fall through the floor, it crashes. Managed to make something fun out of that though: http://i.imgur.com/WNkQjCu.png
MatheMagicianMatheMagician

2013/7/30

Haha! That is awesome Duta. Yes, I know about the edge of the world bug. I never removed it because it was a simple way to know you are out of bounds.
shrucis1shrucis1

2013/11/23

Wow, this looks really cool. I downloaded it and started playing around with the generation, but I noticed something: There is no render limit. I liked the darkness setting which you get after you press M, but I decided to expand upon it. I added some variables for render distance so it still runs smoothly even after you have large 'maps' loaded. I tried adding block placement, but I've found it's sorta difficult to detect which face you're targeting and add a block there. That and I don't really understand the 3D code itself very much at all, XD. Still, this is a really awesome project, and you should expand upon it.
This is EPIC!

See all comments

Want to leave a comment? You must first log in.

Who likes this?

JavaForever Entity1037 PigPen DarkMageCkmario lordhershey Zamoht Rudy Artyoum SPower 8bitcarrotjuice JetLennit FlyingRabidUnicornPig Kartoffelbrot azazeel bourne Game/maniac -nic- Upupzealot Eli.A askgriff