Animate Light position random
-
Diurno
- Posts: 242
- Joined: 10 Jun 2009, 07:50
Animate Light position random
Hi all, i need a spot light that moves the interest point in a random way. How could i achieve this with ICE? Would be perfect if i can define a surface, and the light moves random within the boundaries of that surface.
-
Matic
- Posts: 70
- Joined: 18 Jun 2009, 17:58
Re: Animate Light position random
Irritatingly lights can't host ICE operators directly, so typically to do much with spots etc you need to create a null which reads/writes spotlight properties like in this example http://andy.moonbase.net/archives/1015.
In this case however you just want to animate the interest of a spotlight, right? So it's easier. Add an ice operator to your interest null, and make the interest "wander" by doing well whatever, I would first experiment with adding the current position with the results of animated turbulence.
You can pretty simply constrain the resulting position to the interior of a mesh by testing if the null is inside the mesh, and if it isn't get the closest location on the mesh and make that the current position.
In this case however you just want to animate the interest of a spotlight, right? So it's easier. Add an ice operator to your interest null, and make the interest "wander" by doing well whatever, I would first experiment with adding the current position with the results of animated turbulence.
You can pretty simply constrain the resulting position to the interior of a mesh by testing if the null is inside the mesh, and if it isn't get the closest location on the mesh and make that the current position.
-
Matic
- Posts: 70
- Joined: 18 Jun 2009, 17:58
Re: Animate Light position random
For what it's worth, I've added a scene which does something similar for a camera interest in the resource dump area. ;)
-
Diurno
- Posts: 242
- Joined: 10 Jun 2009, 07:50
Re: Animate Light position random
thanks for the answer, yeah i already thought that i've to apply the ice tree to a null ^^
Btw right now i've to finish the texturing first (it's the same scene), then i will test you suggestion and let you know ^^
Btw right now i've to finish the texturing first (it's the same scene), then i will test you suggestion and let you know ^^
-
Diurno
- Posts: 242
- Joined: 10 Jun 2009, 07:50
Re: Animate Light position random
i'm following this example, and it works very good:
http://caffeineabuse.blogspot.it/2012/01/turbulize-position-of-locator-with-ice.html
the only difference is that i've the X and Z position turbulized.
Now i'm trying to understand how to make the contraining part, but i can't figure it out how to do. What nodes i have to use to create the "If the null is inside the mesh" condition?
http://caffeineabuse.blogspot.it/2012/01/turbulize-position-of-locator-with-ice.html
the only difference is that i've the X and Z position turbulized.
Now i'm trying to understand how to make the contraining part, but i can't figure it out how to do. What nodes i have to use to create the "If the null is inside the mesh" condition?
-
Helli
- Posts: 211
- Joined: 04 Jun 2009, 09:21
Re: Animate Light position random
I would use the "get closest location" node. So you turbulize your position like you did allready and then with this position you use the get closest location on the surface and set the position.
This way the position will be turbulized but allways on the closest position on the surface.
This way the position will be turbulized but allways on the closest position on the surface.
-
Diurno
- Posts: 242
- Joined: 10 Jun 2009, 07:50
Re: Animate Light position random
mmm so where i have to plug the "get cloest location"? Sorry but i'm very nood at Ice... 
-
Helli
- Posts: 211
- Joined: 04 Jun 2009, 09:21
Re: Animate Light position random
This node has more or less 2 inputs. The mesh you want to use and the position which is used.Diurno wrote:mmm so where i have to plug the "get cloest location"? Sorry but i'm very nood at Ice...
In your case the position is like this:
get.kineglobalpos from null feed it into a turbulize around value and use the output of the turbulize as input of the get closest location which is then fed into the transformation matrix of hte null again.
Avtually I am not sure right now if the get closest location works out of the box with a kine.pos input instead of points. Try it, and if not i'll open up xsi and send u a scene.
-
Diurno
- Posts: 242
- Joined: 10 Jun 2009, 07:50
Re: Animate Light position random
mmm something doesn't work.
I've uploaded an image of what i've at the moment.
The problem is that i can't figure it out where i can plug the output of the "get closest location" node, cause i can't feed into the matrix, where the "Scalar to 3d Vector" ends right now.
I've uploaded an image of what i've at the moment.
The problem is that i can't figure it out where i can plug the output of the "get closest location" node, cause i can't feed into the matrix, where the "Scalar to 3d Vector" ends right now.
You do not have the required permissions to view the files attached to this post.
-
Helli
- Posts: 211
- Joined: 04 Jun 2009, 09:21
Re: Animate Light position random
It's a location. So you need to get another get data and plug the location into the source and in the get data add .pointposition (without any prefix before the .)
-
Diurno
- Posts: 242
- Joined: 10 Jun 2009, 07:50
Re: Animate Light position random
ok now it works, but there's a strange thing: i've tried this with a simple square grid, and it works good. After i set up the ice tree, i modified the grid, adding some edge and shaping the grid. The null start to act crazy... I also unplugged and replugged the Geometry node (you never know) but it's still weird. Basically the Null doesn't respect the geometry.
-
Helli
- Posts: 211
- Joined: 04 Jun 2009, 09:21
Re: Animate Light position random
Added a tree.
Actually just adding the position on top of the old one doesnt work so you have to multiply the matrices to add them.
Actually just adding the position on top of the old one doesnt work so you have to multiply the matrices to add them.
You do not have the required permissions to view the files attached to this post.