Re: A85: At the risk of losing you...
[Prev][Next][Index][Thread]
Re: A85: At the risk of losing you...
Uhm... I don't know if anyone noticed this but he described a cube. It
seems like you wouldn't need to have each coordinate of each vertice,
since it's a cube, you could just have the coordinates of the center of
the cube and a height. This is all you need to find the vertices of a
cube. And I guess you'd need to tell the calc what type of object it
was. Most common geometric shapes have properties like this. If you
want to save memory, it might be easier to have these basic shape
properties at first and maybe later add something for user defined
shapes. I'll try and make a list of some of these properties of
different shapes to get you started. The vertices might change if you
plan on adding rotation but the idea is still the same.
Here's how to divide by any number X that is evenly divisible by 2:
shift the number right log base 2 of 8 number of times or
(log 8) / (log 2)
Something that might help people on this list if they wanted to help you
is if you told us your coordinate system. Is z going to be vertical or
will it represent depth? I kind of like using z as vertical because it
is like an extension of a piece of paper, if you could just draw a line
perpendicular going up from your paper.
Cube:
Center x, y, z
Dimensions h (you could make a user or whoever put half the height here
so you don't have to do the dividing)
The user won't need to type this stuf in:
Vertice1 x-h/2, y-h/2, z-h/2
Vertice2 x-h/2, y-h/2, z+h/2
Vertice3 x-h/2, y+h/2, z-h/2
Vertice4 x-h/2, y+h/2, z+h/2
Vertice5 x+h/2, y-h/2, z-h/2
Vertice6 x+h/2, y-h/2, z+h/2
Vertice7 x+h/2, y+h/2, z-h/2
Vertice8 x+h/2, y+h/2, z+h/2
Box:
Center x, y, z
Dimensions l, w, h
Vertice1 x-l/2, y-w/2, z-h/2
Vertice2 x-l/2, y-w/2, z+h/2
Vertice3 x-l/2, y+w/2, z-h/2
Vertice4 x-l/2, y+w/2, z+h/2
Vertice5 x+l/2, y-w/2, z-h/2
Vertice6 x+l/2, y-w/2, z+h/2
Vertice7 x+l/2, y+w/2, z-h/2
Vertice8 x+l/2, y+w/2, z+h/2
I'm going to stop here because it's time consuming and I don't even know
if you'll like this idea. I can think of how you can optimize this even
more by just putting the code for the cube directly above that of the box
and just setting l and w to h.
If you do like this idea notify me personally and I can get you more info
and more detaild properties that would allow rotation.
egillespie@juno.com
erik_gillespie_1096@gwgate.kvcc.edu
"In a prototypical world, nothing ever goes wrong." -Scott Meyers
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
References: