Water ripple (2021)

Author's sample script, wroks, hints.
Post Reply
User avatar
3DfromNULL
Site Admin
Posts: 43
Joined: 2018-Jul-13 9:35

Water ripple (2021)

Post by 3DfromNULL » 2021-Apr-12 10:06

This script generates an animation of circular waves on water surface. There might be several way to make it using trueSpace's feature (e.g. metaball, lattice, point translation, etc.). In this example, it uses NURBS cylinder.

Image
Fig.1. Rendered image (added bump map, reflection, and sky image by hand)

A NURBS cylinder has longitudes and latitudes (as with a simple cylinder) and user can move, rotate, and scale each curve (and control points of it) by hand. The sample script creates a NURBS cylinder with 4 longitude,3 latitude + 1 very small (radius is almost zero) cap, and very short (almost zero) height using NURBSCylinderCreate() so that the cylinder becomes like a spider web.

Image
Fig.2. NURBS cylinder with same top/botom radius

Image
Fig.3. NURBS cylinder (top < bottom)

Image
Fig.4. NURBS cylinder like a spider web (top < bottom, and height ≒ 0)

If user lifts a latitude by hand, it becomes like a wave. The script lifts corresponding control points instead.

Image
Fig.5. Lifting a latitude

Each control point initially exists at each tip of the arrow-shape controls and at its knot. In case that you would like to make sure the location of control points, try to remove (uncomment) "#" around CreateCube().

It's necessary to keep the direction of the each 4-arrow controls set must be kept in order to keep the shape of whole NURBS object. Please note that arrow-tips' which is perpendicular to the propagation direction must get away from the center faster than the knot and the arrows must get longer time by time. If the script mistakenly moves the arrow-tips and the knot with the same speed, the 4 arrows will be "bent" each other and the circular wave will become distorted.

After the script moved control points, it calls NPatchBuildVisRepAuto() in order to let trueSpace re-create the control curves (latitudes and longitudes).

Please note that adjacent two latitudes (inner one and outer one) are necessary in order to keep the distance between rising points (i.e. "wave length") of a wave and to keep their horizontality.

Image

After the script made an animation of wave propagation (deformation of NURBS cylinder's latitudes), it crones the NURBS cylinder, change location randomly, and shift the whole time frames randomly in order to make the scene look like rain drops on the water surface.

This script does not paint any material to the objects. The author added by hand to finish the scene; transparency, reflection, displacement (bump), and a plain that has a "sky" image.



Requirements: tS5 of higher + ptsxpy version 0.0.11 or higher.
(tS4.3 does not have the API function tsxNURBSCylinderCreate().)
Image Image
Image Image Image Image
Attachments
wave1a.py
script file
(5.44 KiB) Downloaded 78 times

Post Reply