I strongly suggest to download the MatrixUtils from IanM in the DLL Talk board.
If you get it, you can easily get those vectors using:
sync on
sync rate 0
make object cube 1, 1
make object sphere 2, 0.5
`Make some vectors
#constant ViewMatrix 1
#constant FrontVec 2
#constant UpVec 3
#constant RightVec 4
make matrix4 ViewMatrix
make vector4 FrontVec
make vector4 UpVec
make vector4 RightVec
do
angle# = wrapvalue(angle# + 0.1)
position camera newxvalue(0, angle#, 10), 5.0, newzvalue(0, angle#, 10)
GetVectors(0)
`This is just to show that the vectors are correct
position object 2, x vector3(FrontVec) * 10 + camera position x(), y vector3(FrontVec) * 10 + camera position y(), z vector3(FrontVec) * 10 + camera position z()
sync
loop
wait key
end
function GetVectors(ID)
`Get the view matrix from that camera
view matrix4 ViewMatrix, ID
`Set vectors
set vector4 RightVec, get matrix4 element(ViewMatrix, 0), get matrix4 element(ViewMatrix, 4), get matrix4 element(ViewMatrix, 8), 0.0
set vector4 UpVec, get matrix4 element(ViewMatrix, 1), get matrix4 element(ViewMatrix, 5), get matrix4 element(ViewMatrix, 9), 0.0
set vector4 FrontVec, get matrix4 element(ViewMatrix, 2), get matrix4 element(ViewMatrix, 6), get matrix4 element(ViewMatrix, 10), 0.0
remstart
`Also possible:
`This does exactly the same as what came before it
`But with this version, if you change the last parameter of set vector4 to 1.0, the camera position will be included
`in the calculations, which might be easier
set vector4 RightVec, 1.0, 0.0, 0.0, 0.0 : transform vector4 RightVec, RightVec, ViewMatrix
set vector4 UpVec, 0.0, 1.0, 0.0, 0.0 : transform vector4 UpVec, UpVec, ViewMatrix
set vector4 FrontVec, 0.0, 0.0, 1.0, 0.0 : transform vector4 FrontVec, FrontVec, ViewMatrix
remend
endfunction
[edit] Sorry I didn't notice that you weren't asking for vectors. But I'll leave it up here for reference.
Cheers!
Sven B