Here's the engine I created for Matrix_Reality.

Dynamic Movement:

Init

----------------

Superscope.

Init

-------------------

The above is the room and a bullet from my Matrix_Reality preset. Here is a basic description of variables:

It limits the pitch to +/-.5 (Vertical) so there aren't any gimble situations, and automatic roll is created for changes in yaw.

Dynamic Movement:

Init

Framecode:

js=.002;pi=acos(-1);pitch=0;yaw=0;density=.33;

Pointcode:

j=if(above(j,1),-1+js*2,j+js);

ox=cos(j*pi)*.125;oy=sin(j*pi)*.5;oz=j*3.5;

ys=yaw;yaw=cos(j*pi)*.125;

roll=(roll*5-ys*5)*.0125;pitch=sin(j*pi)*.125;

pitch=if(above(abs(pitch),.5),sign(pitch)*.5,pitch);

cy=cos(yaw*pi);cx=cos(pitch*pi);cz=cos(roll*pi);

sy=sin(yaw*pi);sx=sin(pitch*pi);sz=sin(roll*pi);

Blend:On | Bilinear:On | Wrap:On | RectCoord:Oncode:

dx=x;dy=y;dz=1;

tx=dx*cy-dz*sy;tz=dz*cy+dx*sy;

ty=dy*cx-tz*sx;dz=tz*cx+dy*sx;

dx=tx*cz-ty*sz;dy=ty*cz+tx*sz;

kx=if(above(dx,0),abs((ox-1)/dx),abs((ox+1)/dx));

ky=if(above(dy,0),abs((oy-1)/dy),abs((oy+1)/dy));

kz=if(above(dz,0),abs((oz-4)/dz),abs((oz+4)/dz));

k=min(min(kx,ky),kz);

utx=oz+dz*kx;uty=oy+dy*kx;utz=ox+dx*kx;

vtx=ox+dx*ky;vty=oz+dz*ky;vtz=oy+dy*ky;

wtx=ox+dx*kz;wty=oy+dy*kz;wtz=oz+dz*kz;

x=if(equal(k,kz),wtx,if(equal(k,kx),utx,vtx));

y=if(equal(k,kz),wty,if(equal(k,kx),uty,-vty));

alpha=(1/pow(2.71828,sqr(k*density)))*(1-abs(pow(j,5)));

----------------

Superscope.

Init

Framecode:

n=200;js=.002;pi=acos(-1);pitch=0;yaw=0;density=.33;bp=.5;

Pointcode:

bp=if(above(bp,-4),bp+.1,if(above(getspec(.1,.1,0),.25),-3.9,bp));bp=if(above(bp,8),-4,bp);

by=if(above(bp,4),by*1.1,.05);

ox=cos(j*pi)*.125;

oy=sin(j*pi)*.5;

oz=j*3.5;

sy=sin(-yaw*pi);

sx=sin(-pitch*pi);

sz=sin(-roll*pi);

cy=cos(-yaw*pi);

cx=cos(-pitch*pi);

cz=cos(-roll*pi);

pitch=if(above(abs(pitch),.5),sign(pitch)*.5,pitch);

roll=(roll*5-ys*5)*.0125;

pitch=sin(j*pi)*.125;

ys=yaw;yaw=cos(j*pi)*.125;

j=if(above(j,1),-1+js*2,j+js);

Draw: Linescode:

dx=cos(i*pi*20)*.01-ox;

dy=sin(i*pi*20)*.01-oy+by-.05;

dz=i*.05-oz+if(above(bp,4),4,3+(1-pow(1-(bp+4)*.125,3)*8))*.35;

tx=dx*cz-dy*sz;ty=dy*cz+dx*sz;

dy=ty*cx-dz*sx;tz=dz*cx+ty*sx;

dx=tx*cy-tz*sy;dz=tz*cy+tx*sy;

a=if(above(bp,-4),(1/pow(2.71828,sqr(dz*density))),0);

red=if(below(dz,.1),0,1)*a;

green=red;

blue=0;

k=1/if(equal(dz,0),1,dz);

x=dx*k;y=dy*k;

-------------------

The above is the room and a bullet from my Matrix_Reality preset. Here is a basic description of variables:

- ox,oy,oz = Camera Position
- pitch,roll,yaw = Camera Rotation Angles
- density = Fog Density (Exponential Squared)
- j = Synchronization Variable (js = timing speed)

It limits the pitch to +/-.5 (Vertical) so there aren't any gimble situations, and automatic roll is created for changes in yaw.

## Comment