[ALLY] I didn't make it to the bottom of his web page.
From: chaz::innocent::com at: 25-Oct-2000 21:15
REBOL [
Title: "tamahori"
Date: 23-OCT-2000
File:
%tamahori.r
Author: "chaz, based on Che Tamori"
Email:
[chaz--innocent--com]
Purpose: {
Not yet working partial REBOL port of
Shockwave code on http://www.sfx.co.nz/tamahori/thought/shock_3d_howto.html
Thanks to Gabriele for the Expression Evaluator.
Hey, Star Trek fans, use this prompt!
system/console/prompt: ["Computer, "]
}
Category: [view VID 3]
]
points: [
[-50 50 -50]
[50 50 -50]
[-50 -50 -50]
[50 -50 -50]
[-50 50 50]
[50 50 50]
[-50 -50 50]
[50 -50 50]
]
max: func[
a b
][
either greater-or-equal? a b [
a
][b]
]
min: func[
a b
][
either lesser-or-equal? a b [
a
][b]
]
RotateXY: func [
xangle yangle points
][
foreach point points [
zpos: subtract multiply point/3 cosine yangle multiply point/1 sine yangle
newpoint: copy []
append newpoint add multiply point/3 sine yangle multiply point/1 cosine
yangle
append newpoint add multiply point/2 sine xangle multiply zpos cosine xangle
append newpoint subtract multiply point/2 cosine xangle multiply zpos
sine xangle
change point newpoint
print point
]
]
viewpoints: func [
{
-- points: list of points
-- xoff: x of the center of rotation onscreen
-- yoff: y of the center of rotation onscreen
-- depth: depth of perspective. 900 looks ok...
}
points xoff yoff depth
][
foreach point points [
scalar: divide 1 add divide multiply point/3 1 depth 1
print ["scalar: " scalar]
xp: multiply point/1 scalar
yp: multiply point/2 scalar
print ["xp: " xp " yp:" yp]
pcast: max min subtract 38 multiply 24 scalar 17 10
print ["pcast: " pcast]
locH: add xp xoff
locV: subtract yoff yp
print [locH locV]
]
]