Planetside Software Forums

General => Image Sharing => Topic started by: nikita on July 20, 2007, 05:52:13 PM

Title: Double Helix
Post by: nikita on July 20, 2007, 05:52:13 PM
Someone recetly stated that he doesn't understand why some people like the node network so much.
This image was done with functions in the node network, and it's these kind of structures you can't do without getting familiar with the node interface and understand how everything works.
Using the node network, you can create scenes that are unique.

The image has some bugs in it though  :( So I had to do a little bit of painting.


I hope you like it, even though it's quite simple and ordinary.  :)
Title: Re: Double Helix
Post by: old_blaggard on July 20, 2007, 05:57:00 PM
Wow... very cool!  I would love to see the .tgd for this!  I've been playing with the node network and have had some sucess with making interesting shapes, although this brings it to a whole new level!
Title: Re: Double Helix
Post by: Volker Harun on July 20, 2007, 06:01:07 PM
Whom do I have to give a hug for this TGD? ,)
Title: Re: Double Helix
Post by: rcallicotte on July 20, 2007, 06:35:12 PM
Great job, nikita.

[edit] - oh yeah...and a TGD...?  A possibility?  Or maybe a tutorial or show us the node network and a tutorial.  Just asking.   :-[
Title: Re: Double Helix
Post by: nikita on July 20, 2007, 06:58:00 PM
Thanks!

To be honest - I'm not a big fan of sharing such files. Call me egoistic but I don't like thought of somebody simply loading the tgd without doing any work. Also, the feeling of success is much bigger, when you've done it yourself.  :)
That being said: A tutorial would be possible.. or at least some screenshots and detailed explanations. I think lots of people wouldn't really understand the file without documentation anyway.

But it's 12:55am over here, so this will ahve to wait til tomorrow or sunday.
Title: Re: Double Helix
Post by: rcallicotte on July 20, 2007, 08:49:27 PM
This is very cool and I'll learn from a tutorial as well as I could with the TGD.  3DGuy did the same and I learned lots from him, while I've still learned from Ben, O_B, Moodflow, Volker, and many others by studying and rebuilding their TGD or TGC.  Your choice, if you're willing to share your knowledge and that gift of a tutorial will be plenty for me.

Thank you!



Quote from: nikita on July 20, 2007, 06:58:00 PM
Thanks!

To be honest - I'm not a big fan of sharing such files. Call me egoistic but I don't like thought of somebody simply loading the tgd without doing any work. Also, the feeling of success is much bigger, when you've done it yourself.  :)
That being said: A tutorial would be possible.. or at least some screenshots and detailed explanations. I think lots of people wouldn't really understand the file without documentation anyway.

But it's 12:55am over here, so this will ahve to wait til tomorrow or sunday.
Title: Re: Double Helix
Post by: cyphyr on July 21, 2007, 05:38:47 AM
wow thats really something. I'd love to be able to figure out how you did this but I completely understand your reticence in shearing this kind of stuff.
A couple of questions on the side then:
1/ Are you a math/logic genius? Seriously, I've looked at the function node system many times and I cant figure out how to get started. Even taking apart shared systems I don't get why they work.
2/ Would it be possible (in your image) to have the helices blending in with the ground plane rather than breaking through it.
I hope in the final release (maybe sooner :) ) that there will be a not simplified but somehow easier to understand version of the function node network. Someone could write a book on this stuff (hint). I guess that the "displacement holes" or "broken ploys" aere something Planetside will fix, they look identical to the issues seen when using bump maps.
Darn good work
richard
Title: Re: Double Helix
Post by: RealUser on July 21, 2007, 06:39:25 AM
Cool man, i fully understand that you don't want to share everything. ;-)
Title: Re: Double Helix
Post by: ozijon on July 21, 2007, 06:39:53 AM
Nice work and yes best keeping things to your self

                   well done
Title: Re: Double Helix
Post by: Mavcat on July 21, 2007, 06:47:05 AM
Very unique,this kind of stuff makes terragen a great program :)
Title: Re: Double Helix
Post by: nikita on July 21, 2007, 06:51:11 AM
Thanks :)
Quote from: cyphyr on July 21, 2007, 05:38:47 AM1/ Are you a math/logic genius? Seriously, I've looked at the function node system many times and I cant figure out how to get started. Even taking apart shared systems I don't get why they work.
Working with mathematical functions is something you need experience for. You have to know, what the standard functions x x² sqrt(x) log, exp, sin, cos etc.. look like, and how to manipulate and combine them. Unless you study something like maths, computing science (like me), you'll have to work with your knowledge from school, which is still enough... if you've been good in maths. And if you didn't understand mathematics back then, there's still a good chance that you can learn it now. :)
The complicated thing is, to imagine functions in a three-dimensional space.
A sprial is something, you might not be able to describe by functions unless you have the right idea and can think in 3D.
Implementing it in TG2 is trivial (it would be, if there were a complete documentation).

Quote from: cyphyr on July 21, 2007, 05:38:47 AM2/ Would it be possible (in your image) to have the helices blending in with the ground plane rather than breaking through it.
Yes, probably. I recently tried to create a network of functions that would blur the terrain but it didn't really work.
Title: Re: Double Helix
Post by: nikita on July 21, 2007, 09:43:08 AM
Ok, here's a small tutorial for the double helix.
I attached an early version of the tgd, which doesn't contain a helix, but it shows the basics of the method of displacement. :)
There's also a screenshot of the network from the final version.


I took the following steps to create the double helix:
- make a simple pillar
- use displacement to turn it into a helix
- combine two helices into one double helix

For the pillar, I used a simple cone.  I don't want to go into the details, because I think that's not the interesting part of this network. ;)

Creating a helix/spiral
I used displacement and redirects to achieve the shape I wanted. You can see, there are some trigonometric functions. If you take a look at the wikipedia page for "Helix", you'll find the following way to define a helix in three-dimensional space:
    x = cos(t)
    y = sin(t)
    z = t

Before we look into the use of this definition in TG2, lets try and understand why this definition actually works.
I attached a picture of a phone cord, shot from the side. As you can see, it follows the sine function. This is represented by the line "y = sin(t)"
Now.. if we rotate the cord by 90°, it is still a sine function, but it's shifted by 90°, which is cosine.

Now we need to adjust the definition. First of all, we simplify it to
    x = cos(z)
    y = sin(z)
We also have to fit it into the coordinate system of TG2, where Y is the altitude and the values of X and Z depend on the altitude:
    X = cos(Y)
    Z = sin(Y)
We use displacement to represent functions in TG2, but displacement doesn't work exactly in our desired directions.
A simple redirect solves the problems - it allows us to displace the pillar in X and Z-direction.
That's it.

Combination
Now we build another helix (copy/paste) with some minor adjustments: It's z-value has to be added with pi, so the two helices aren't congruent but twist around each other.
I just couldn't figure out, how to do combine the two sprials with shaders, so I used another planet, identical to the already existing one and placed the second helix there. Because both planets are at exactly the same position, the two spirals grow at the same place and form a double helix.
Title: Re: Double Helix
Post by: ozijon on July 21, 2007, 11:36:10 AM
WOW!    :o
Title: Re: Double Helix
Post by: ThinkPink on July 21, 2007, 12:28:45 PM
Ahhh ....  I think, that was a hint to me :) with the nodes  .... looks nice but .....  :-\
perhaps i do somewhere in the far future a landscape with a double-helix like the lp-covers of Roger Dean (Uriah Heep, Yessongs) in the late 70th.

nice weekend
Title: Re: Double Helix
Post by: rcallicotte on July 21, 2007, 12:52:04 PM
Thank you, nikita.  This is going into my list of tutorials.  Thank you for your help.
Title: Re: Double Helix
Post by: old_blaggard on July 21, 2007, 02:40:04 PM
Ah, that makes sense.  Thanks :).
Title: Re: Double Helix
Post by: bigben on July 21, 2007, 08:52:23 PM
Very cool nikita.

Maybe math teachers should introduce TG2 into classes to make math more interesting/ practical  :)
Title: Re: Double Helix
Post by: Volker Harun on July 22, 2007, 03:18:22 AM
Worth while patience! Thanks for sharing the technique!
Title: Re: Double Helix
Post by: Volker Harun on July 22, 2007, 04:06:59 AM
What I do not understand, why do make x² and z², combine them to one scalar and make a square root - you can just delete all those nodes.
Title: Re: Double Helix
Post by: nikita on July 22, 2007, 07:51:52 AM
sqrt(x²+z²) is not equal to x+z
(unlike sqrt(x²*z²) = x*y)

Of course you could delete those, but then you wont get a cone but a pyramid. :)
Title: Re: Double Helix
Post by: Tinga on July 22, 2007, 08:09:24 AM
Thanks for your tutorial, Nikita :)
Title: Re: Double Helix
Post by: Volker Harun on July 22, 2007, 09:12:53 AM
Hi Nikita,
well, x and z are not added in a numerous way but are combined to a scalar, where x and z are handled seperatly, aren't they.
For example x=4 and z=4 then the addition is (4|0|0)+(0|0|4)=(4|0|4) - if I should be right then the nodes can be deleted.
And a testrender shows a cone, not a pyramid.
Title: Re: Double Helix
Post by: nikita on July 22, 2007, 09:39:24 AM
If I delete them, the cone turns into a wall or a pyramid if i add the necessary abs()'. There is no way you could get a cone without using at least the x2,z2 nodes.

This is the way how I understand it works:
X to scalar: (x,y,z) -> x (the function assigns to a vector its x-component [and doesn't remember that this has once been an x-value])
Y to scalar: (x,y,z) -> y
...

A scalar, that handled xyz seperately would be a vector. Why would we need the concept of a scalar if it was just a special form of vector?
Title: Re: Double Helix
Post by: Matt on July 22, 2007, 09:58:14 AM
Quote from: nikita on July 22, 2007, 09:39:24 AM
If I delete them, the cone turns into a wall or a pyramid if i add the necessary abs()'. There is no way you could get a cone without using at least the x2,z2 nodes.

This is the way how I understand it works:
X to scalar: (x,y,z) -> x (the function assigns to a vector its x-component [and doesn't remember that this has once been an x-value])
Y to scalar: (x,y,z) -> y
...

A scalar, that handled xyz seperately would be a vector. Why would we need the concept of a scalar if it was just a special form of vector?

That is correct Nikita. Scalars only remember one component, but if you later feed a scalar into a node that expects a vector (or colour) it will copy the scalar into each of the 3 components.

Matt
Title: Re: Double Helix
Post by: Volker Harun on July 22, 2007, 10:03:58 AM
You are right, but you are adding two different ordinates not two Xs.

See the attached image that 'if' you delete it will not be a pyramid.
Title: Re: Double Helix
Post by: Matt on July 22, 2007, 10:06:56 AM
Hi Volker,

This works in TG2 because TG2 conveniently converts vectors into scalars by taking the magnitude of the vector if you don't explicitly specify how that conversion should take place :-)

There is also a function in the Convert menu called "Length to scalar" which does the same thing.

Matt
Title: Re: Double Helix
Post by: nikita on July 22, 2007, 10:14:04 AM
That explains everything  :)
Title: Re: Double Helix
Post by: Volker Harun on July 22, 2007, 10:22:16 AM
I had my final exams in maths - it was about vectors in 4-dimensions - I remember now very good, why I almost failed :D
But I 'd rather like to stop spamming this thread. Again I was just lucky with what I was doing ,-)