3D LOGO!

Published November 16, 2005
Advertisement
Well advancing on from my cube last time I decided to make myself a tree. After a couple of silly mistakes which I really shouldn't have made I ended up with this:



HMm, it could use a little colour though. That's easy enough, make a linear scale from 0 at the bottom to 1 at the leaves and interpolate between a nice brown and a green.



That's looking a little better now! It could do with a bit of tweaking, the green is coming in a bit too early, but that's all right I can apply a function to the linear scale to get one that has a gradient slow, then fast at the end.

The next step was to increase the feeling of 3D - a nice ground plane would do this nicely:



Looking good!

After that what I plan to do is add grass (maybe) and clean up the code (a lot). Still, it's not bad for a graphics system that only uses straight lines.
Next Entry Final image
0 likes 2 comments

Comments

benryves
Very cool. [smile]
Do you have any way to get pixel coordinates, or can you only deal with the scale the turtle offers?
November 16, 2005 05:15 AM
baldurk
Well the code I'm provided with takes the LOGO commands and dumps them to a postscript file, so I can scale the postscript output by a single value. Unfortunately if I make the picture too small then the lines become noticably thick (they are a fixed size, so they scale up too). So I need to keep it at a certain level.

Still, it's not too limiting. The main two points that make it usable are the inkless brush and branching. With those two it's easy to make a branch, translate to the beginning of a line, draw the line, then end the branch. That way you can draw any number of lines simply by concatenating the different branches. After that you just need to build up your internal representation of the vertices, and write a function to project it all to 2D lines.

Getting colour in is a bit more hassle, but it's possible :)
November 16, 2005 09:01 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement