Page 189
Quick Nav Bar
<<   Previous Contents
Selection
Op Index
Parent User Notes
Index
Glossary
Next   >>


Texturemaps

Let's add some character to the cueball. We'll add a texturemap marble effect to simulate chalk marks on the ball.

The script would look like:
<libpath "c:\w3\">
<lib "textures.w3d">

<seed 10>
This sets the randon number generator to a certain point in the random sequence, as long as this is the same, the texturemapper will produce the same result.

    <normalize>

Pool ball:
    <position 0 0 0> <radius 3>
    <apply "glossy">
    <reflectivity 0.1>
    <color 1 0 0>
    <imagemap "c:\imagemaps\raytrace_imagemap_1.jpg">
    
<object sphere "My Sphere">
    <normalize>

Cue Ball:
    <position -7 0 0> <radius 3>
    <apply "glossy">
    <reflectivity 0.1>

    <specular 0>
    <roughness 0>
    With these two, we make the cueball look less shiny and more chalked and worn.

    <color 1 1 1>
    <color 0 0.5 1>
    Set the colors for the texturemap, color0 is the color of the ball, color1 is the color of the chalk.

    <texturemap "marble" 0.01 30>
    This adds a marble effect to the cueball, giving it a chalked look. See the language reference on texturemapping for more info.

    
<object sphere "My Sphere">
    <normalize>
<object bound>

Light:
    <position 50 50 -75>
    <color 1 1 1>
<object light "light_1">

<viewlocation 0 0 14>
<viewtarget -3 0 0>



This is the end product of the script.

To the advanced concepts.


Quick Nav Bar
<<   Previous Contents
Selection
Op Index
Parent User Notes
Index
Glossary
Next   >>
Page 189

WinImages F/x, WinImages Morph and all associated documentation
Copyright © 1992-2007 Black Belt Systems ALL RIGHTS RESERVED Under the Pan-American Conventions

WinImages F/x Manual Version 7, Revision 5, Level B

HTML Documentation Management System © 1992-2007 Black Belt Systems