Hi all,
I've just started with dbpro a couple of days ago. I've previously done a bit of hobby 2D game programming using c# and XNA and now I want to have a bash at 3D. I struggled with the steep (for me) learning curve that came with moving to 3D programming in XNA so I thought I'd give dbpro a try as I've read good stuff about it.
I've got an object, with camera follow, moving around on a matrix and following the matrix height, but I can't figure out how to align the object to the slope of the ground.
Looking at the blurb for the EXRotate plugin it seems that it might have a function to enable me to do the object to ground alignment easily.
Before I shell out my hard earned readies, can anyone who has used EZRotate confirm whether on not it has that functionality?
Here's my code snippet for moving an object over a matrix with the camera following it, in case it's of any use to someone. (I searched for ages and couldn't find a working example myself, so I had to work it out the hard way
)
Rem Project: Dark Basic Pro Project
Rem Created: Tuesday, May 21, 2013
Rem ***** Main Source File *****
Set Display Mode 1024,768,32,1
Sync On
Sync Rate 0
Backdrop On
Color Backdrop 0
autocam off
`Position Camera 50,20,0
make matrix 1,100,100,10,10
for x=2 to 7
for y=4 to 7
set matrix height 1,x,y,-5
next y
next x
update matrix 1
make object cube 1,10
color object 1,rgb(255,255,0)
position object 1,50,0,20
do
if keystate(17)=1 then move object 1,1
if keystate(31)=1 then move object 1,-1
if keystate(18)=1 then turn object right 1,1
if keystate(16)=1 then turn object left 1,1
position object 1, object position x(1), get ground height(1,object position x(1),object position y(1))+5 , object position z(1)
camerafollow(0,1,20,50)
sync
loop
function cameraFollow(camNum,objNum,height#,dist#)
set camera to follow camNum,object position x(objNum),object position y(objNum),object position z(objNum),0,0,height#,1,0
set camera to object orientation objNum
move camera 0,-dist#
endfunction
So far I'm really liking dbpro, really glad I decided to switch, however I might use the GDK and c# instead, as I'm more comfortable with something a bit more structured.
Anyway thanks for reading, and I'm sure I'll have more questions soon