Using animated texture to create plasma charge!

Using animated texture to create plasma charge!

Postby Skinnytorus » Sunday, 08.July 2012, 07:42

Hey guys,
Here is another example how to create plasma. This time by using an animated texture. Enjoy! :)
You do not have the required permissions to view the files attached to this post.
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Using animated texture to create plasma charge!

Postby ikam » Sunday, 08.July 2012, 07:48

good idea, nice ;)
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Using animated texture to create plasma charge!

Postby erbsen » Sunday, 08.July 2012, 12:11

Nice, could anyone explain the meaning of the code in the rotate-Op (for non coders)?

Code: Select all
gui
{
  float r(-10..10 step 0.001);
}

import i:float;
Offset=1+2*sin(i*r);
erbsen
Operator
Operator
 
Posts: 873
Joined: Thursday, 15.July 2004, 23:00
Location: Os

Re: Using animated texture to create plasma charge!

Postby Skinnytorus » Sunday, 08.July 2012, 12:57

hi, erbsen.
To tell the truth, I found this structure in the example file and adapted for my needs ;)
I can understand most of the things going on unconsciously, but, I have too many blank spaces in my knowledge, so it would be better if a coder commented on that. ;)
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Using animated texture to create plasma charge!

Postby erbsen » Sunday, 08.July 2012, 16:32

=) Ok.
erbsen
Operator
Operator
 
Posts: 873
Joined: Thursday, 15.July 2004, 23:00
Location: Os

Re: Using animated texture to create plasma charge!

Postby ikam » Sunday, 08.July 2012, 23:04

Hi

Code: Select all
gui
{
  float r(-10..10 step 0.001);
}


here we declare a new gui entry 'r' : a float variable with range from -10 to +10 with a step value of 0.001 (when you move mouse).


Code: Select all
import i:float;


Tell that 'i' is a variable declared in another place but we want to use here, so we need to import it. (i is declared in loop operator)

Code: Select all
Offset=1+2*sin(i*r);


and here we calculate offset with a math formula and our 2 variable i and r.

Is it ok ?
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Using animated texture to create plasma charge!

Postby Skinnytorus » Monday, 09.July 2012, 07:10

Thanks. Very concise and to the point.
The most confusing part in this structure is the loop and atlas though.
I think Loop op creates some sort of cycle. What I don't understand is where is the counter then?
Is "i" the counter? What is "n" in Loops op?

As for Atlas, it seems to work as a frame recorder with buffer depending on 'i' variable .
It seems to record 'i' (declared in Loop op) frames, but doesn't show them all in preview (depends on the resolution).
Correct?
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46

Re: Using animated texture to create plasma charge!

Postby erbsen » Monday, 09.July 2012, 08:21

Very enlightening thank you very much ikam.
erbsen
Operator
Operator
 
Posts: 873
Joined: Thursday, 15.July 2004, 23:00
Location: Os

Re: Using animated texture to create plasma charge!

Postby ikam » Monday, 09.July 2012, 08:54

Yes loop operator is a cycle.

"from 0 to n-1" is the loop end value, don't take care of 'n', it's not a variable, it's only represent the value you enter here. So your loop will repeat 'n-1' time. (In programming language most of loop start from 0, so end loop is endvalue-1, ex to repeat 10 times an action, loop is 0 to 9).

'i' is a variable containing the loop index, so it's start with 0 and finish with your value-1. So you can use 'i' in your script, his value will range from 0 to your endvalue-1.

For atlas, yes it use variable name declared in loop as counter.

Here another example:

In conclusion, just indicate in loop op the count you want to repeat an action (don't compute n-1)
You do not have the required permissions to view the files attached to this post.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Using animated texture to create plasma charge!

Postby ikam » Monday, 09.July 2012, 09:01

here an interesting example of what we can do with loop :
You do not have the required permissions to view the files attached to this post.
ikam
Operator
Operator
 
Posts: 911
Joined: Friday, 14.October 2011, 13:00
Location: France

Re: Using animated texture to create plasma charge!

Postby Skinnytorus » Monday, 09.July 2012, 10:19

many thanks, ikam.
i will check your files out this evening. :)
by and large, a fully fledged step-by-step tutorial based on some real task might come in handy for non-coders.
i will dig this deeper and maybe come up with something of that kind ;)
Skinnytorus
Operator
Operator
 
Posts: 1300
Joined: Monday, 06.February 2012, 17:46


Return to Tutorials



Who is online

Users browsing this forum: No registered users and 17 guests

cron