Main Categories: | Landscape | Fenceposts | Wildlife | Trees | Mushrooms | Art | Games || All Posts ||
for daily images, visit my ||Tumblr||
Showing posts with label spiral. Show all posts
Showing posts with label spiral. Show all posts

Tuesday, 4 March 2014

Spirals

I wrote a while back about how elegant spirals can be in computer games - in particular, they are useful if you want to iteratively cover a space with evenly distributed points, with the range expanding out from a single starting location and with one growing tip - I have used them in the past for searching for a suitable placement point in a landscape for a game object, but I'm sure there are many other applications.


Anyway, I didn't include any code in that post, so here below is a Spiral function that is ready to use. This is written in C# for Unity, but should be easy enough to convert to whatever you happen to be using.

Vector3 Spiral( float dist, float spacing ) {
float rad = Mathf.Sqrt(  dist / (Mathf.PI*spacing ));
float angle = Mathf.PI * 2.0f * rad;
 
Vector3 retVal = Vector3.zero;
retVal.x = spacing * rad * Mathf.Sin( angle );
retVal.z = spacing * rad * Mathf.Cos( angle );
return retVal;
}



'dist' is the distance along the line of the spiral from the origin, and 'spacing' is how far apart you want the coils of the spiral to be from each other (this spiral has the handy attribute of maintaining a constant radial distance between each concentric coil.)

To achieve an even distribution of points, increment the distance param by the value of spacing - that way points will be equally distant form their neighbours on the line as they are from the neighbouring coils.

Here is a screen shot of the points generated by calling Spiral( dist, 1.0f ) with dist = [0,1,2,3...] As you can see, the unit spheres are packed pretty close to 1 unit apart:



Changing the spacing to 2.0f and iterating Spiral( dist, 2.0f) with  dist = [0,2,4,6,8...] will lead to each of the unit spheres having 1 unit's space between them:



...Spirals!



Sunday, 9 December 2012

Ammonite


Yet another ammonite. There are no fossil records for any part of an ammonite other than their curly shells (and a small, mysterious clamshell-shaped bodypart occasionally found in association with them.) 
So, what they looked like is a legitimate subject for conjecture - their closest living relatives are squid (not nautili) and this is a pretty conservative guess as to what they might have looked like. I might try an alternative design next time - one with more face armour.

Saturday, 1 December 2012

Ammonite Landscape

First really involved painting I've done in quite a while. Ammonites make for great places to live... if they're big enough.



Friday, 28 August 2009

Spirals



It is amazing how little use is made of spirals in computer games, they are really useful shapes - they can iteratively cover a 2d surface from a starting point in all directions quite evenly while still only having one growing tip, and they have an intrinsic beauty that is all their own.

Tuesday, 23 June 2009

Slings and Arrows of Financial misfortune

Today we will be looking at safeguarding your company's future in these uncertain times:



This diagram clearly shews a small dev studio admirably prepared to cope with the worst the Credit Crunch can throw at it. Provided you are able to rope the staff together tightly, you should be able to construct an overarching defensive shell - large and tough enough to shield the whole organisation from even the worst slings and arrows of outrageous financial fortune, whilst remaining sufficiently agile to cope with the most tortuous of your clients' caprices.