Animate Light position random

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Post Reply
User avatar
Diurno
Posts: 242
Joined: 10 Jun 2009, 09:50

Animate Light position random

Post by Diurno » 06 Feb 2013, 16:14

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, 19:58

Re: Animate Light position random

Post by Matic » 06 Feb 2013, 21:13

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.

Matic
Posts: 70
Joined: 18 Jun 2009, 19:58

Re: Animate Light position random

Post by Matic » 07 Feb 2013, 18:18

For what it's worth, I've added a scene which does something similar for a camera interest in the resource dump area. ;)

User avatar
Diurno
Posts: 242
Joined: 10 Jun 2009, 09:50

Re: Animate Light position random

Post by Diurno » 08 Feb 2013, 11:59

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 ^^

User avatar
Diurno
Posts: 242
Joined: 10 Jun 2009, 09:50

Re: Animate Light position random

Post by Diurno » 08 Feb 2013, 17:17

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?

Helli
Posts: 211
Joined: 04 Jun 2009, 11:21

Re: Animate Light position random

Post by Helli » 08 Feb 2013, 17:25

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.

User avatar
Diurno
Posts: 242
Joined: 10 Jun 2009, 09:50

Re: Animate Light position random

Post by Diurno » 08 Feb 2013, 19:42

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, 11:21

Re: Animate Light position random

Post by Helli » 08 Feb 2013, 20:06

Diurno wrote:mmm so where i have to plug the "get cloest location"? Sorry but i'm very nood at Ice... :(
This node has more or less 2 inputs. The mesh you want to use and the position which is used.
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.

User avatar
Diurno
Posts: 242
Joined: 10 Jun 2009, 09:50

Re: Animate Light position random

Post by Diurno » 08 Feb 2013, 23:22

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.
Attachments
ice.jpg

Helli
Posts: 211
Joined: 04 Jun 2009, 11:21

Re: Animate Light position random

Post by Helli » 08 Feb 2013, 23:35

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 .)

User avatar
Diurno
Posts: 242
Joined: 10 Jun 2009, 09:50

Re: Animate Light position random

Post by Diurno » 08 Feb 2013, 23:52

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, 11:21

Re: Animate Light position random

Post by Helli » 09 Feb 2013, 01:20

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.
Attachments
nullposition.jpg

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests