Hello everyone,
I tried this snippet a couple of times before but I couldn't get it to work.
And now it works!
(I think it's because I got a hard bang in the face and broke my nose)
sync on : sync rate 80 : hide mouse
make object sphere 1,5
make object sphere 2,1
angle# = 0.0
`make multiple camera's
color backdrop 0 : set camera view 0,0,320,240
position camera 0,50,0,0 : point camera 0,0,0,0
make camera 1 : color backdrop 1,0 : set camera view 1,320,0,640,240
position camera 1,0,50,0 : point camera 1,0,0,0
make camera 2 : color backdrop 2,0 : set camera view 2,0,240,320,480
position camera 2,0,0,50 : point camera 2,0,0,0
make camera 3 : color backdrop 3,0 : set camera view 3,320,240,640,480
position camera 3,50,50,50 : point camera 3,0,0,0
do
angle# = wrapvalue(angle# + 1)
orbit1(2,0,0,0,angle#,45.0,15)
sync
loop
function orbit1(id,cx#,cy#,cz#,angy#,angz#,dist#)
`calculate the distance according to angz# (x and y)
firstadd# = sin(angz#) * dist#
add_disty# = sin(angy#) * firstadd#
add_distx# = cos(angz#) * dist#
`calculate position
posx# = newxvalue(cx#,wrapvalue(angy#),add_distx#)
posz# = newzvalue(cz#,wrapvalue(angy#),add_distx#)
posy# = cy# + add_disty#
`update position of id
position object id,posx#,posy#,posz#
endfunction
This function shows how to calculate a point on an orbit around a center (cx#,cy#,cz#) at a given angle (angy#). The maxangz# variable determines the zrotation of the orbit. And you can use the dist# variable to determine the total distance to the center.
EDIT: It's written in DBP but the function will also work in DBC.
Immunity and Annihalation makes Immunihalation...