Planetside Software Forums

General => Terragen Discussion => Topic started by: Vortex on May 10, 2012, 02:44:10 PM

Title: Crater shader's <<<S>>>>
Post by: Vortex on May 10, 2012, 02:44:10 PM
Hello all,

I'm trying to create a script similar to this guys script http://www.theglasseye.nl/terragen/
Don't know if its just me but it never works correctly doesn't link up the nodes and various other little bug, anyway iv fixed a few little issues with it, but im having real problems with the positioning of the craters.

I'm throwing in some random numbers into the x y z position which is obviously the issue, as when i right click on my moon and copy coordinates and paste them into each node they work perfectly.

So what im really asking is how can the coordinates i generate relate to the moon location.

Moon center : xyz: 1.36398e+006, 796695, 2.99393e+006

And the .tgc script i generate is attached, any ideas, thoughts would be great!

Title: Re: Crater shader's <<<S>>>>
Post by: Hetzen on May 10, 2012, 04:47:43 PM
To cover that moon, you'll have to create random angles that you use trig functions to solve the x,y,z with a given radius for each crater shader. You would then have to off set that position by your moon's x,y,z location to get the craters to sit on the surface of the moons sphere.
Title: Re: Crater shader's <<<S>>>>
Post by: Vortex on May 10, 2012, 06:13:22 PM
Hey thanks fro your reply, however I'm somewhat lost by it  ??? :o

Why would i need to use other nodes in terragen to place the crater on the moon?
When if i do it manually all i need to do is place the coordinates in and the crater on the moon is placed...

I'm trying to think of a way to generate those coordinates randomly but be relative the the spheres surface?

Once again thanks for you thoughts :)
Title: Re: Crater shader's <<<S>>>>
Post by: Hetzen on May 10, 2012, 06:31:57 PM
I was trying to explain how your script would need to work, to generate those xyz co-ordinates on a planet that didn't have 0,0,0 as its pole.

The script you linked to is only meant to cover a flatish area. The problem you will find when you try to cover a moons surface with crater positions, is that you are actually dealing with a sphere rather than a plane. So you have to think of a way find random xyz coordinates that sit on a spheres surface, which can be done with Sine and Cosine equations.
Title: Re: Crater shader's <<<S>>>>
Post by: Dune on May 11, 2012, 02:51:17 AM
There's a few other ways around to randomly make craters if that's what you need. Like here: http://www.planetside.co.uk/forums/index.php?topic=7327.msg85491#msg85491 (http://www.planetside.co.uk/forums/index.php?topic=7327.msg85491#msg85491)
If you use the search function you'll find more, I'm sure.
Title: Re: Crater shader's <<<S>>>>
Post by: TheBadger on May 11, 2012, 04:07:44 AM
QuoteSine and Cosine equations

Its a whole new world for me.
Title: Re: Crater shader's <<<S>>>>
Post by: bobbystahr on May 12, 2012, 12:32:50 PM
Quote from: TheBadger on May 11, 2012, 04:07:44 AM
QuoteSine and Cosine equations

Its a whole new world for me.
with a very different language as well....heh heh heh
Title: Re: Crater shader's <<<S>>>>
Post by: Vortex on May 12, 2012, 06:45:32 PM
Well i now have a working script, that seems to do the job quite well, with a little more tweaking i should be able to get something much better than Ive got already.
My script is practically the same as the other guys feed in some information about the object you want to cover in craters click submit and bam a tgc file is created for you to import.

Once i have tweaked it i will put it on my site so others can use it, if anyone is interested that is.

Thanks for all the suggestion and it will be good to give something back to the community finally :)