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


Multiple Objects & Changing View

What good is a pool ball if you don't have a cueball?

Adding the second object is a small matter. The reflectivity of the objects has to change to seem more realistic. The target viewpoint was also changed so that both objects were within the viewing frustrum.

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

    <normalize>

Pool ball:
    <position 0 0 0> <radius 3>
    <apply "glossy">
    <reflectivity 0.1>
    We need to change the reflectivity of the balls because the resulting image was unrealistic. While pool balls are glossy, they are not very reflective. The trait "glossy" sets reflectivity to full. The resulting objects look more like colored mirrors than pool balls. This command overrides the reflectivity set by the trait.
    <color 1 0 0>
    <imagemap "c:\imagemaps\raytrace_imagemap_1.jpg">
    
<object sphere "My Sphere">
    <normalize>
Cue Ball:
    <position -7 0 0> <radius 3>
    Place the cueball to the right of the four ball.
    <apply "glossy">
    <reflectivity 0.1>
    See the identical command (above).
    <color 1 1 1>
    Set the object color to white (100% red, 100% green, 100% blue)
    
<object sphere "My Sphere">
    <normalize>
<object bound>
Object bounds play a key role in the efficiency of the ray tracing engine. You must have at least one bound at the end of your script. (more below)

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

<viewlocation 0 0 14>
<viewtarget -3 0 0>
Look at the point 3 units to the right of the center of the ray tracer's universe.

A bound is a sphere that encompasses all the objects in the scene since the beginning of the scene or the last bound if there are previous bounds in use. Bounds add to the efficiency of the ray tracer by acting as a general test case. If the light ray does not intersect the bounding sphere, there is no necessity to follow up by testing for intersection with any object inside the bounding sphere. The more complex the scene, the more resources you save by bounding groups of objects that are near each other.


This is the end product of the script.

Let's add to the complexity of this scene. Go on.


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

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