It is a question about moving fx.
Let's look a script in Flash ActionScript 2.0:
***
onClipEvent (load) {
var speed:Number;
var Xpos:Number = 5;
this._x=0
}
onClipEvent (enterFrame) {
speed = (Xpos-this._x)*0.1;
this._x += speed;
}
***
Now, I create a box and try to re-write this ActionScript in Houdini.
How to set it in Houdini?
How to make variables calculate every single frame?
speed should be changed every frame, and fix object's x position every frame,too.
If you have any question about this, please point it out.
Let me fix it ASAP.
Thanks!
Moving Fx Question.
4050 6 0- dim1984kimo
- Member
- 84 posts
- Joined: Aug. 2008
- Offline
- jesta
- Member
- 311 posts
- Joined: July 2005
- Offline
- dim1984kimo
- Member
- 84 posts
- Joined: Aug. 2008
- Offline
- jesta
- Member
- 311 posts
- Joined: July 2005
- Offline
- edward
- Member
- 7694 posts
- Joined: July 2005
- Offline
dim1984kimo
How to make variables calculate every single frame?
Your scripting is in the imperative form [en.wikipedia.org] while Houdini's scripting works in the functional form [en.wikipedia.org].
To make a parameter change with time, a common way is to use the variable, $F, which is the current frame number.
If I guessed at your action script code correctly, you have a simple recurrence formula which I hope I have solved correctly to this expression:
5 - 5*pow(0.9,$F-1)
I've attached a simple .hip file.
- dim1984kimo
- Member
- 84 posts
- Joined: Aug. 2008
- Offline
Hi,
Thank you all for this question.
I explain it now. My target is make an emitter which emits many woods and clays, they will automatically go to their position to build a house.
But it's not that kind of simple movement, I want it to be an acceleration or negative acceleration. If this target goaled, it should be step to next level, such as Simple Harmonic Motion with negative acceleration. That's my final goal.
If I wanna change to Simple Harmonic Motion with negative acceleration, then the AS needs to fix like this:
speed = (Xpos-this._x)*0.3+speed*0.9;
Thank you all for this question.
I explain it now. My target is make an emitter which emits many woods and clays, they will automatically go to their position to build a house.
But it's not that kind of simple movement, I want it to be an acceleration or negative acceleration. If this target goaled, it should be step to next level, such as Simple Harmonic Motion with negative acceleration. That's my final goal.
If I wanna change to Simple Harmonic Motion with negative acceleration, then the AS needs to fix like this:
speed = (Xpos-this._x)*0.3+speed*0.9;
- shanshore
- Member
- 6 posts
- Joined: May 2009
- Offline
-
- Quick Links