Posts: 64
Joined: Sun Oct 21, 2012 5:48 pm
Location: USA

Re: pi3d: how to organize?

Wed Mar 20, 2013 9:58 pm

sorry, I think you misunderstood me. I'm not useing blender for my tower defence, I just wanted to know if I could use it for more complicated games in the future. (:

User avatar
Forum Moderator
Forum Moderator
Posts: 4257
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: pi3d: how to organize?

Wed Mar 20, 2013 10:56 pm

Amy's presentation on Conway's Game of Life got me thinking about Pi3D. You could model live cells as trees. Each generation that the tree lives it could grow taller and more complex; there are recursive algorithms for building life-like trees. When it dies the leaves fall off and it looks all bare and decays. Each generation could be modelled as a day with the lighting changing appropriately. And you could walk around a living woodland. You could even tie it in to real time, so one generation would be one real day. Each time you start it up it spins time forward to the right point.

*groan* No way can I do it; not enough hours in the day, or days in the week.

User avatar
Posts: 2591
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: pi3d: how to organize?

Thu Mar 21, 2013 10:51 am

Hmm, nice idea. The problem is probably at the python end. Tim's ForestWalk works because the trees are merged into one object with one matrix ( + assoc. uniform variables) needing to be multiplied and sent to the gpu each frame. If they were all individual trees it would grind to a halt. Worse if each tree was more than a couple of crossed planes.

However you could do something cunning with the vertex shader:
1. forest is a single object grid of crossed planes (as per ForestWalk trees)
2. texture for drawing the trees has 9 (say) images
3. 2nd texture is generated by tree of life algorithm with pixels representing grid squares
4. 2nd texture is passed to vertex shader and used to figure out which part of image to use and modify texture coordinates sent to fragment shader

It would be quite good if you could 'plant' a seed on a grid square, or 'add nutrients', or ...


PS if you cobble some of it together I will hack the shaders to make it work

Return to “Python”