The script is called d3d_set_projection_simple:

//d3d_set_projection_simple() made by Rafferty97//arg0 - x//arg1 - y//arg2 - z (height above ground)//arg3 - direction (looking at)//arg4 - up/down (0=looking forward, 90=looking straight up, -90=looking straight down)//arg5 - roll (0 = Normal, 90 = Leaning Right, 180 = Upside down, 270/-90 = Leaning Left)var xx, yy, zz, tx, ty, tz, ux, uy, uz, nx, ny, nz, ax, ay, az;xx = argument0yy = argument1zz = argument2tx = lengthdir_x(1,argument3)ty = lengthdir_y(1,argument3)tz = 0ax = lengthdir_x(1,argument3+90)ay = lengthdir_y(1,argument3+90)az = 0ux = 0uy = 0uz = 1//look up/downnx = vector_rotate(tx,ty,tz,ax,ay,az,argument4*(pi/180),0)ny = vector_rotate(tx,ty,tz,ax,ay,az,argument4*(pi/180),1)nz = vector_rotate(tx,ty,tz,ax,ay,az,argument4*(pi/180),2)tx = nxty = nytz = nznx = vector_rotate(ux,uy,uz,ax,ay,az,argument4*(pi/180),0)ny = vector_rotate(ux,uy,uz,ax,ay,az,argument4*(pi/180),1)nz = vector_rotate(ux,uy,uz,ax,ay,az,argument4*(pi/180),2)ux = nxuy = nyuz = nz//rollingnx = vector_rotate(ux,uy,uz,tx,ty,tz,-argument5*(pi/180),0)ny = vector_rotate(ux,uy,uz,tx,ty,tz,-argument5*(pi/180),1)nz = vector_rotate(ux,uy,uz,tx,ty,tz,-argument5*(pi/180),2)ux = nxuy = nyuz = nz//setting_projectiond3d_set_projection(xx,yy,zz,xx+tx,yy+ty,zz+tz,ux,uy,uz)

To use this, you also need this script called vector_rotate():

//vector_rotate() made by Rafferty97// x, y, z, ux, uy, uz, angle, r(x = 0, y = 1, z = 2)var xx, yy, zz, ux, uy, u, angle, r, mx, my, mz, s, c;xx = argument0yy = argument1zz = argument2ux = argument3uy = argument4uz = argument5angle = argument6s = sin(angle)c = cos(angle)r = argument7if r=0 {return (xx*( sqr(ux)+((1-sqr(ux))*c) ))+(yy*( (ux*uy*(1-c))-(uz*s) ))+(zz*( (ux*uz*(1-c))+(uy*s) ))}if r=1 {return (xx*( (ux*uy*(1-c))+(uz*s) ))+(yy*( sqr(uy)+((1-sqr(uy))*c) ))+(zz*( (uy*uz*(1-c))-(ux*s) ))}if r=2 {return (xx*( (ux*uz*(1-c))-(uy*s) ))+(yy*( (uy*uz*(1-c))+(ux*s) ))+(zz*( sqr(uz)+((1-sqr(uz))*c) ))}

This function rotates the vector (x, y, z) along axis (ux, uy, uz) by angle degrees.

I know this can be greatly optimized, so I will edit it later.

Here is an example of how to use it: Download advancedTest.gmk

Hope this can help people making 3D games,

-Alex

**Edited by Rafferty97, 06 January 2010 - 11:50 AM.**