Cube size documentation problem?

James M Grimes <[email protected]> Thu, 17 Feb 2005 14:21:37 -0800
Newsgroups gmane.comp.breve
Message-ID <[email protected]>
The documentation for the Cube type implies that the elements of the 
size vector are half the length of each side:

	"size refers to the vector from the center to one point, so the for a 
vector (x, y, z), the actual size of the rectangular solid will be 2*x 
by 2*y by 2*z. "

However it appears that it the actual size really is x by y by z.  To 
prove the point, the following simple program show the cube as half the 
size of the other 3 objects, using the same "radius."  Is this correct, 
or am I confused?

Thanks,
Jim Grimes



@use PhysicalControl.
@use Stationary.

Controller TestSize.

PhysicalControl : TestSize {
     + variables:
         cube, disk, cone, ball (object).
         r, h (float).
         n (int).

     + to init:
         self enable-shadow-volumes.
         self set-light-exposure-source to (1000.0, 1000.0, 1000.0) .
         self point-camera at (0,0,0) from (0, 1000, 10).
         self enable-lighting.
         self set-z-clip to (3000.0).
         self move-light to (0, 33, 25).
         self set-light-ambient-color to (1.0, 1.0, 1.0) .
         self set-light-diffuse-color to (1.0, 1.0, 1.0) .
         self set-background-color to ((1.0,1.0,1.0) - 
random[(0.3,0.3,0.3)]) .

         self set-display-text-scale to .4 .
         # self enable-outline.

         r = 100.0 .
         h = 50.0 .  # squat
         n = 6 .
         ball = new Stationary .
         cube = new Stationary .
         cone = new Stationary .
         disk = new Stationary .
         # place the objects 2*r apart, so that they should be touching
         ball register with-shape (new Sphere init-with radius r)
                         at-location (-r*3, 0, 0).
         cube register with-shape (new Cube init-with size (r,r,r))
                         at-location (-r*1, 0, 0).
         cone register with-shape (new PolygonCone init-with radius r 
sides n height h)
                         at-location (r*1, 0, 0).
         disk register with-shape (new PolygonDisk init-with radius r 
sides n height h)
                         at-location (r*3, 0, 0).
     + to iterate:
         self sleep for-seconds .1 .    # to get a stop in edge-wise

}

___________________________________________________

Disclaimer:  Opinions stated herein are my own, and do not reflect 
policies or opinions of the Jet Propulsion Laboratory, NASA, or the 
California Institute of Technology.

James M Grimes                            Phone:  1-818-354-3890
Jet Propulsion Laboratory            Fax:       1-818-393-5239
Section 313 - Flight Systems       E-mail: [email protected]
Mailing  Address:                           Office Location: 301-475U
     Jet Propulsion Laboratory, M/S 301-486
     4800 Oak  Grove Drive
     PASADENA  CA 91109-8099

_______________________________________________
breve mailing list
[email protected]
http://lists.spiderland.org/mailman/listinfo/breve