Here's a small example (wrote quick) of how to make that (non limb though):
type vector
x as float
y as float
z as float
endtype
sync on : sync rate 60
autocam off : hide mouse
color backdrop rgb(16,16,16)
setupViewportGrid()
// quick setup of a camera
position camera -(128),128+64,-(128+64)
point camera 0,0,0
cy# = camera angle y() : ncy# = cy#
cx# = camera angle x()+5 : ncx# = cx#
do
cr# = 0 : cf# = 0
speed# = 4.0
sm# = 5.0
if rightkey()=1 or KEYSTATE(32)=1 then cr# = -speed#
if leftkey()=1 or KEYSTATE(30)=1 then cr# = speed#
if upkey()=1 or KEYSTATE(17)=1 then cf# = speed#
if downkey()=1 or KEYSTATE(31)=1 then cf# = -speed#
ncr#=curvevalue(cr#,ncr#,sm#)
ncf#=curvevalue(cf#,ncf#,sm#)
cx#=cx#+mousemovey()*0.2
cy#=cy#+mousemovex()*0.2
if cx#>80 then cx#=80
if cx#<-80 then cx#=-80
ncx#=curveangle(cx#,ncx#,sm#)
ncy#=curveangle(cy#,ncy#,sm#)
move camera ncf#
rotate camera 0,wrapvalue(ncy#-90),0
move camera ncr#
rotate camera 0,wrapvalue(ncy#+90),0
rotate camera ncx#,ncy#,0
set cursor 0,0
print "WASD to move, mouse look to rotate"
sync
loop
#constant VIEWPORT_GRIDSIZE 512.0
#constant VIEWPORT_GRIDCOUNT 16
function setupViewportGrid()
local v1 as vector
local v2 as vector
local row as integer
local col as integer
local gridHalf as float
local resultSize as float
gridHalf = (VIEWPORT_GRIDSIZE*.5)
resultSize = (VIEWPORT_GRIDSIZE/VIEWPORT_GRIDCOUNT)
for row = 0 to VIEWPORT_GRIDCOUNT
v1.x = -gridHalf
v1.y = 0.0
v1.z = (row*resultSize)-gridHalf
v2.x = gridHalf
v2.y = 0.0
v2.z = (row*resultSize)-gridHalf
if row = (VIEWPORT_GRIDCOUNT*.5)
createWireMesh( v1, v2, rgb(0,0,12) )
else
createWireMesh( v1, v2, rgb(12,12,12) )
endif
next
for col = 0 to VIEWPORT_GRIDCOUNT
v1.x = (col*resultSize)-gridHalf
v1.y = 0.0
v1.z = -gridHalf
v2.x = (col*resultSize)-gridHalf
v2.y = 0.0
v2.z = gridHalf
if col = (VIEWPORT_GRIDCOUNT*.5)
createWireMesh( v1, v2, rgb(0,0,12) )
else
createWireMesh( v1, v2, rgb(12,12,12) )
endif
next
endfunction
function createWireMesh( v1 as vector, v2 as vector, Color as dword )
local d as vector
local n as integer
local dist as float
n = find free object()
make object triangle n ,0,0,0 ,0,0,0 ,0,0,1
position object n,v1.x,v1.y,v1.z
point object n,v2.x,v2.y,v2.z
d.x = v2.x - v1.x
d.y = v2.y - v1.y
d.z = v2.z - v1.z
dist = sqrt( d.x * d.x + d.y * d.y + d.z * d.z )
scale object n,0,0,100.0*dist
set object diffuse n, color
set object emissive n, color
set object wireframe n, 1
endfunction n