this is for people who for some very strange reason need a frustum...maybe they're making the lower part of a hot air balloon envelope.Maybe not.Here it is :
make_object_frustum(1,4,2,4)
`it's a normal object! you can color it etc
color object 1,rgb(0,255,0)
sync on:sync rate 0
point camera object position x(1),object position y(1),object position z(1)
do
text 10,10,"a nice green erotic ... frustum."
sync
loop
`returns distance between 2 3D points
function dist3d(x1#,y1#,z1#,x2#,y2#,z2#)
temp = make vector3(1)
set vector3 1,x1#-x2#,y1#-y2#,z1#-z2#
dist# = abs(length vector3(1))
temp = delete vector3(1)
endfunction dist#
`this function is great!!
`it gets the y angle between 2 2d points
function yangle(xa#,za#,xb#,zb#)
`this is the anlge that pointA would have if pointing towards pointB
two = make vector3(2)
three = make vector3(3)
set vector3 2,xb#-xa#,0,zb#-za#
set vector3 3,0,0,1
angle# = acos((dot product vector3(2,3))/(length vector3(2))*abs(length vector3(3)))
if xb#-xa# < 0 then angle# = 360-angle#
two = delete vector3(2)
three = delete vector3(3)
`here we use the newvalue commands
`position object obja,newxvalue(xa#,angle#,-1*(size#-dist#)),oldy#,newzvalue(object position z(obja),angle#,-1*(size#-dist#))
endfunction angle#
function make_object_frustum(objno,base_r#,small_r#,height#)
make object cylinder objno,2*base_r#
LOCK VERTEXDATA FOR LIMB objno,0
for V = 0 to GET VERTEXDATA VERTEX COUNT()-1
y# = GET VERTEXDATA POSITION Y(V)+object position y(objno)
if y# > (object position y(objno))
dist# = dist3d(GET VERTEXDATA POSITION X(V),0,GET VERTEXDATA POSITION Z(V),0,0,0)
angle# = yangle(GET VERTEXDATA POSITION X(V),GET VERTEXDATA POSITION Z(V),0,0)
SET VERTEXDATA POSITION V, newxvalue(GET VERTEXDATA POSITION X(V),angle#,(dist#-small_r#)),height#-base_r#,newzvalue(GET VERTEXDATA POSITION Z(V),angle#,(dist#-small_r#))
endif
next V
unlock vertexdata
endfunction
you can specify base radius,small radius and height
A study done by William Speyer, who was a victim of prison rape in 1989, shows that 34% of [prison] rape victims released from prison become child molestors.