Roulette (2019)

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

Roulette (2019)

Post by 3DfromNULL »

Let's make a 3D model of roulette and a animation for it from the empty. First, we define the name of parts as:

Let's assign variable names to dimensions. These are defined only at the beginning of the 1st script. The 2nd and the 3rd script reffers the dimensions not from the 1st script but from the created objects if needed.

Finished and rendered images. Added the green table and some spot lights by hand (not by the script).

What the 1st script should do is to make some cylinders, cubes, tori, texts, small pyramids, and a sphere, and to apply some boolean operations to them. For example, the shape of a hole of pocket frame is cylinderA - cylynderB - CubeA - CubeB.

As another choice, we could use texture map (i.e. a 2D image) to display numbers, but that is not generative.
Let's make 3D numbers instead.

I added several cameras by hand, set one of them "Look-at" so that it always looks at the ball from a fixed point, rendered 4 animations, and gathered them into a movie file.

Attached three scripts are for (1) Making a model of roulette, (2) Coloring the model, and (3) Add physical properties to the model. The 1st script must be executed before other ones.
You can run these script with tS5.1 and later. But if you use tS5, you should set two fixation points by your hand because the tS5's tsxAPI does not have the function for setting these points. The two fixation points should be set on the z-axis of the rotor to avoid precession.

After the 3rd script's execution was done, you can click "Start simulation" button. It will take very long time, compute and make a physical simulation. Before click it, you should adjust the simulation time, the number of simulation steps for one frame, the gravitational acceleration, the properties of the rotor and a created ball. To get results you want, you may adjust initial rotation/linear speeds of rotor and ball. You don't have to redo the physical simulation after you changed these speeds, and can get the result by "Play" button. But please note that you should rewind animation (using "Return to start" button) before you change these values, colors, locations, rotations, sizes. Otherwise (i.e. changing values at time non-zero) you will get a property-changing-animation.

The script can be run on tS5 or higher. (tS4.3 does not have tsxTextCreate() API function and cannot create the number blocks though it can make the rounded rim)
Image Image
Image Image Image Image
script file for modeling
(22.25 KiB) Downloaded 1567 times
script file for coloring
(6.03 KiB) Downloaded 1536 times
script file for animating
(5 KiB) Downloaded 1557 times
Post Reply