I’ve been developing code to draw a 3D village that you can walk through, allowing buildings to be defined very simply.
Code is here - https://gist.github.com/dermotbalson/5538596
Images are here - https://www.dropbox.com/sh/6sfspcbmje3hngh/mz7wCaRhO4
(zipfile included as well, for convenience)
If you get it running, the pink building on the right has interior settings, just walk right inside and have a look around
Some screen shots are below. I can’t do a video because the picture breaks up if I try.
For those who are interested, each building has walls with the same texture, a wall colour tint (if you want one), a roof, and whatever door, windows, or graffiti you want to add. The buildings have insides as well, of course.
This is the code for the most elaborate building, most of the settings are x,y,w,h and image
b:BuildingWalls(20,140,100,70,30,"Dropbox:map-whitewall2",.05,15) b:AddTint(color(255,255,0,50)) b:AddFeature(3,30,0,10,20,"Dropbox:map-door1-030") b:AddFeature(3,5,5,15,10,"Dropbox:map-poster1-030") b:AddFeature(4,1,0.5,8,10,"Dropbox:map-Ignatz1-999") b:AddFeature(4,80,0,8,10,"Dropbox:map-door10-130") b:AddFeature(4,30,5,25,10,"Dropbox:map-window3-300") b:Roof(2,"Dropbox:map-roof1-100",.5)
The whole village so far can be defined in 50 lines of code, with about 300 lines of “engine” code to do all the meshes. The image textures come from all over the internet - any image will do.
I wanted to be able to add things like trees and animals, but of course, the problem is they are 2D images and will look flat from the side. So I cheated, and provided for these images to rotate themselves so they are always facing you. The dog is in two pictures above, taken from different angles, but he has turned himself to face me.
Simple touch navigation lets you walk around the whole map.
I haven’t decided where all this is going yet, but I decided to share at this point in case anyone is interested and wants to get involved. This code could be used to build 3D sets for games, if it is efficient enough.