PDA

View Full Version : moving objects with ocean waves



stephefrank
08-07-2014, 11:05 PM
hi all,
I am using H.O.T plugin for lightwave for oceans, water etc. I was wondering is there anyway to make an object move up and down with waves automatically?

THANKS!

JohnMarchant
08-08-2014, 12:54 AM
Not at LW at the moment but attach a Null to the ocean and parent the ship to the null, then move the null how you want. Do a google search there is a tutorial on this im sure. Also where you download the HOT plugin check out the scenes especially Lino's one.

Shiny_Mike
08-08-2014, 01:43 AM
Cageman's videos:
https://code.google.com/p/hotocean4lw/wiki/Tutorials

Thomas Leitner
08-08-2014, 02:29 AM
Hi Stephen,
Try SP_Floater:

http://www.segelson.com/SP_Floater.html

ciao
Thomas

stephefrank
08-08-2014, 02:37 AM
Thanks everyone!
Thomas this motion modifier is awesome :)
thanks

Every4thPixel
08-08-2014, 02:39 AM
I recently made a new setup for this. This works not only with displacement but also with dynamic oceans if you use cloth dynamics for waves.
This really is a nice way to animate a moving boat because it interpolates between the front and the back of the boat respecting the waves movement.
It's actually really simple:

1. Create a displacement object like the one you already have. ;)
2. Now make a spline control item and make some control points. These cp's will be your motion path. Ignore the Y put make sure the cp's a above the displacement at any time.
3. Add the raycast node to every cp you have and attach you boat or floating object using bones to it.

Now you can change the animation path and the boat will move automatically over the waves.

4. If you find the motions to wild you can bake the animation and smooth the curves in the grapheditor

I think this is the easies and fastest way to animate a boat..... and it also a good one! :D

erikals
08-08-2014, 05:36 AM
yes, i think raycast would be good for this

lardbros
09-03-2014, 10:20 AM
In a similar vein...

I have a little rubber duckie on a HOT ocean displacement, using the raycast node... Unfortunately, as in the Content Material (the car on uneven terrain) the movement of the car (and my duck) is very 'polygonal', as in, it's not smooth across the surface because it's just rotating based on the normal of the polygons, NOT the smoothed normal.

I was wondering if there was any smart Nodal people who could tell me how to effectively use nodes to 'dampen' or smooth out the rotational movement. It's very jumpy and jittery, mainly because of the subdivided mesh having so many polys on it, and not being able to use a smoothed normal for the raycast.

I may just use the tips above anyway, but to satisfy my curiosity, I'd love to know how to do this nodally! :D

erikals
09-03-2014, 11:21 AM
it might be that the LightWave content provided at the LW download area might have some examples?

Ryan Roye
09-03-2014, 11:25 AM
Another option: Use the sticky/stickysurface motion modifiers on your objects. These two motion modifiers work together...

Example:

Take your ocean object and apply "StickySurface" to it.
Then, select your object and apply "Sticky". Your object should adhere to the geometry (including any deformations), and you can tweak the settings to your liking. Make certain that the motion path or initial keyframe of the object is just above the geometry so that it calculates properly as thats how sticky determines the position/orientation of things.


Unlike raycasting, sticky/stickysurface can use smoothed normals in its calculations. The only drawback is that it is less efficient with CPU resources, so excessive geometry or many instances of this plugin can slow down Lightwave enough to require keyframe baking for smooth playback.

Once raycasting gets the capability of utilizing smoothed normals, then we can consider sticky/stickysurface a depreciated tool.

lardbros
09-03-2014, 11:26 AM
Sorry erikals... I checked the content, and it has the same issue.

If you load up the car on uneven terrain, it jerks as it gets to a new polygon. It doesn't transition from one polygon to another smoothly... I'm facing this, but much much worse as I have many smaller undulating polygons in my HOT ocean! :(

Any nodal ideas you clever people?

lardbros
09-03-2014, 11:28 AM
Another option: Use the sticky/stickysurface motion modifiers on your objects. These two motion modifiers work together...

Example:

Take your ocean object and apply "StickySurface" to it.
Then, select your object and apply "Sticky". Your object should adhere to the geometry (including any deformations), and you can tweak the settings to your liking. Make certain that the motion path or initial keyframe of the object is just above the geometry so that it calculates properly as thats how sticky determines the position/orientation of things.


Unlike raycasting, sticky/stickysurface can use smoothed normals in its calculations. The only drawback is that it is less efficient with CPU resources, so excessive geometry or many instances of this plugin can slow down Lightwave enough to require keyframe baking for smooth playback.

Ohhhh yeah... forgot about sticky!
Does the surface have to be UV'd too or something? That shouldn't be a problem, but just remember something to do with UV's.

Thanks Ryan, I'll give that a go, as well as the plugin Thomas posted earlier!

I'd still love to find a nodal solution, the maths can't be too tricky?!! Can it?! :D

Ryan Roye
09-03-2014, 11:30 AM
Does the surface have to be UV'd too or something?

Nope. I think you're thinking of "Anchor", which positions an object along the surface of a UV map on another object... in which case it'd be handy when very precise placement/movement along a surface is required.

lardbros
09-03-2014, 11:34 AM
Nope. I think you're thinking of "Anchor", which positions an object along the surface of a UV map on another object... in which case it'd be handy when very precise placement/movement along a surface is required.

Ha... indeed that is exactly what I was thinking of! :)

vector
09-04-2014, 12:02 AM
Munky shared a file in which he used an old tutorial by Ben Smith to get that effect. You can try http://forums.newtek.com/showthread.php?57249-Float-with-Wave

erikals
09-04-2014, 01:07 AM
Munky shared a file in which he used an old tutorial by Ben Smith to get that effect.
You can try http://forums.newtek.com/showthread.php?57249-Float-with-Wave
could work i guess, as it it a textured displacement and textured movement

----------

hm, thought raycast was the solution... maybe not, i guess there is no way of upping the accuracy of raycast ?
tested Raycast_Car_Track.lws with the track subdivided, worked good...

not sure why it didn't work. what about using APS ? increasing the mesh detail in the affected area might help

Every4thPixel
09-04-2014, 03:22 AM
Like I described in my earlier post if you use more then one raycast node and nulls you can generate an average value to smooth the motion. That is basically what the spline does for the Pitch in my setup.

Danner
09-04-2014, 04:05 AM
And the more you separate the nulls the softer the swaying.

Every4thPixel
09-04-2014, 05:59 AM
Exactly

lardbros
09-04-2014, 10:20 AM
Like I described in my earlier post if you use more then one raycast node and nulls you can generate an average value to smooth the motion. That is basically what the spline does for the Pitch in my setup.

Yeah, that was my next step... tried the Sticky, and the duck kept slipping around randomly. Must be something to do with the way it interprets the data.

The spline control on nulls is a great solution... thanks! :D

Still, intrigued to know if there's a nodal only solution to smooth a normal from a raycast. Using just the input from the single raycast.

Mr_Q
09-04-2014, 10:26 AM
The easiest way to do this or attach anything to a deformed object is to run ClothFX on the item. Scan it, then go to EDIT FX and EXPORT MOTION. This creates a null with the motion for what ever vertex you select. Once you activate EDIT FX you can go to layout view and pick a vertex or you can use the Edit Tool in Edit FX to run through all of them until you find the one you want.

You can then parent to that null or save its motion to then use any channels you want.

I've been doing this since ClothFX came out for putting items on animated deformed objects. Works great, and it's easy. Even for super dense meshes ClothFX's scan (MDD basically) is quite zippy.

124036

jeric_synergy
09-04-2014, 10:45 AM
One thing about these tried and true methods is some don't seem amenable to revision or resisitant to UVP (Unexpected Vice Presidents). That is, you have to repeat the scanning and whatnot if the deformation changes.

IIRC in his node tutorials (now free on youtube?) RH showed methods of attaching to individual points and to multiple points for vectors and normal-ish data (well, maybe not the last). I think he specifically mentions holsters attached to characters as an example of a rigid object attached to a deforming object. Chosing 2 points established a vector for the holster to be aligned on.

For a boat on turbulent water I'd think you'd want at least a vector, although it'd be nice if Bank could also be accomodated automagically. Otherwise the Bank could be hand animated.

And of course nodal motion is updated continuously.

lardbros
09-04-2014, 03:18 PM
This is kind of the reason I'd want to do this purely with nodal motion really.
Ideally I don't want to scan it and make an .mdd every time I make a change.

If I use the HPB node that came with the 11.6 content for raycast, I can get my duck to obey the surface perfectly, it terms of banking, pitch and heading, it's just I'd want it to be the smoothed normal.

The clothfx thing doesn't quite work if I want my duckie moving along the waves. Or have I misunderstood your process?

jeric_synergy
09-04-2014, 03:47 PM
If I use the HPB node that came with the 11.6 content for raycast, I can get my duck to obey the surface perfectly, it terms of banking, pitch and heading, it's just I'd want it to be the smoothed normal.
Unless it's literally impossible, this is the kind of thing Denis is very good about adding to his nodes.

Failing that, is it possible/adequate to take an average of a bunch of spots (in the technical sense) rather than JUST the sole raycast point of contact?

Like, an average of normals from the corners of the duck's bounding box? It might be sufficient for production, even if not mathematically correct.

lardbros
09-04-2014, 04:08 PM
Unless it's literally impossible, this is the kind of thing Denis is very good about adding to his nodes.

Failing that, is it possible/adequate to take an average of a bunch of spots (in the technical sense) rather than JUST the sole raycast point of contact?

Like, an average of normals from the corners of the duck's bounding box? It might be sufficient for production, even if not mathematically correct.

I did wonder that. The guys in my office said it's not possible, and they're more the programmer types.

The best solution is the spline one... I can see that working perfectly... just thought it must be possible in another way. Denis or Bryphi would know I'm sure! :D

jeric_synergy
09-04-2014, 04:23 PM
I did wonder that. The guys in my office said it's not possible, and they're more the programmer types.

The best solution is the spline one... I can see that working perfectly... just thought it must be possible in another way. Denis or Bryphi would know I'm sure! :D
Well, while it may not be possible in a single node, nothing's stopping YOU from constructing a network that would do it.

Whether it would actually work is another issue.... :eek:

Every4thPixel
09-05-2014, 04:34 AM
You could generate an average out of a bunch of vectors, but you won't be able to do anything useful with this information because you will run in to LW's deformation order trouble.
If you for example put 4 nulls on every corner of your boundingbox (rubber ducky) and apply the ray cast geo node to every null you can easily calculate the average by adding the values ​​and dividing it by the number of nulls you use. This adding and dividing is done in the node editor of a other null. The problem is that the node editor of that particular null is evaluated before the ray cast nodes do their work.

I don't think there is a way around this. You could however do this in the nodal displacement editor but this would be a lot slower then using the spline technique. You can even improve the spline technique by baking the final animation and smoothing the curves in the graph editor. An other way is to use a second displacement object with less detail to smooth out the motion. (lower the frequencies and or small scale)

Every4thPixel
09-05-2014, 06:12 AM
I had not much to do today so I fired up layout and found a solution. Here's a short description of what I did:

1. Create 4 nulls (with the ray cast node applied to it) approximately fitting the bounding box of you ducky and parent those nulls to a main mover null.
2. Create a plane with on every corner a skelegon (if you want with weight maps for ever point/bone )
3. Convert the skelegons to bones in Layout.
4. Use same as item to attach the bones to the nulls
5. Use the instance generator to attach your ducky to the plane. Set the instance generator to Polygons and in the rotation settings align it to the normal.
6. Animate the Main null and you are done!

Every4thPixel
09-05-2014, 07:14 AM
For any one who finds my explanation a bit lousy... Here is my scene.
Increasing the Display sub-patch level increases the accuracy of the motion. Placing the diamond shaped nulls closer together will make the motion a bit more wobbly.

pinkmouse
09-05-2014, 08:16 AM
Ha, and I thought I would be the first one to think of using Instancer to align the normals! Mine is a little simpler setup though.


http://youtu.be/hfQ75K1B1es

Used trigon driven by the same displacement network as the water, with duck instanced to it. Should perhaps have spent a little more time on the modelling though... ;)

pinkmouse
09-05-2014, 10:21 AM
Add more tri's, get more duckies! :D


https://www.youtube.com/watch?v=39MXP950yjo&feature=youtu.be

jeric_synergy
09-05-2014, 10:50 AM
The concept "using Instance Generator with ONE item" should be become a standard meme in the LW animator toolkit.

(I'm typing this to cement it in my own head, hopefully.)

+++++++++++++++++++
Some pedantry here, for clarification:

Used trigon driven by the same displacement network as the water, with duck instanced to it. Should perhaps have spent a little more time on the modelling though... ;)
#afc When you say "the same displacement network", you mean an IDENTICAL network, correct? IOW, if you need to change it, you need to change two networks in two different Node Editor instances, right?

It would be hugely convenient if one could have a change to one network propagate to another, and if you've managed that I want to know (#afc #aflw if it's in the scene....).

+++++++++
Historical note: using MathMotion (?), I accomplished a similar thing back in the day, you whippersnappers, for a simple buoy animation. No rotation though, just translation. (These particular buoys were quite stabile.)

pinkmouse
09-05-2014, 11:57 AM
...When you say "the same displacement network", you mean an IDENTICAL network, correct? IOW, if you need to change it, you need to change two networks in two different Node Editor instances, right?

It would be hugely convenient if one could have a change to one network propagate to another, and if you've managed that I want to know (#afc #aflw if it's in the scene....).

Yes, two different, but identical networks. If you wanted a global update, you can always store data in a null(s), (nine data slots: xyz,hpb, and size xyz) and use those to set the texture attributes. Not ideal, but it does work.

jeric_synergy
09-05-2014, 01:32 PM
If you wanted a global update, you can always store data in a null(s), (nine data slots: xyz,hpb, and size xyz) and use those to set the texture attributes. Not ideal, but it does work.
Ahhh, thank you for that reminder. :thumbsup:

Every4thPixel
09-05-2014, 02:24 PM
Yes, two different, but identical networks. If you wanted a global update, you can always store data in a null(s), (nine data slots: xyz,hpb, and size xyz) and use those to set the texture attributes. Not ideal, but it does work.

That's also a good solution. It looks like it wobbles a little more like you would expect with a setup that aligns a model directly to the normal. I''m wondering what's the fastest method. A double displacement or the raycast setup? It's both not a very clean way of doing things... I think the spline technique works best for this kind of animations. It's the smoothest one. But now it's time for a pint. ;)