Here is another one for you, to try to explain a little in this little tutorial ima make up
Sync On
Sync Rate 30
Load Object "C:\Textures\3d\Aircraft\Test2.x",1
Scale Object 1,100,100,100
Position Object 1,0,0,100
Make Camera 1
Position Camera 1,0,0,0
Rem Define Variables
oPitch# = 0
oRoll# = 0
Remstart
+=+=+=+=+=+=
Do main loop starts here
+=+=+=+=+=+=
Remend
Do
Rem Creat Input incommands for the object to rotate
If Upkey()=1 Then Dec Pitch#,3
XRotate Object 1,Pitch#
If Downkey()=1 Then Inc Pitch#,3
XRotate Object 1,Pitch#
If RightKey()=1 Then Dec Roll#,3
YRotate Object 1,Roll#
If LeftKey()=1 Then Inc Roll#,3
YRotate Object 1,Roll#
Sync
Loop
ok, im going to start with the basics (Most of this I learned in the tutorials, and, a nice DarkBasicPro programmer I met on the forums (im sorta a n00b as well).
Anywas, the sync commands
Sync is short for syncronize, which, basically sets it so that the frames can be shot. Basically, like in a theatre when they close the curtains, the stage is moved, and then opens, and there is a new scene. Neways, then, Sync Rate 30 is how many times a second this happens (Fast stage crew).
Now, onto a little more.
Load Object "C:\Textures\3d\Aircraft\Test2.x",1 Loads an object i have in one of my folders. Now, you should download your own to do this cause, it doesnt work unless you have mine in the same directory. So, save a 3d object into the same folder you save this code too, and do this
Load Object "[3d models name]",1
The second parameter is the number index, or, basically, name that you wanna give it. It can only be a number, no text. Use that number to do certain things to your object
Scale object works like a magnifying glass does. It can shrink of enlarge the object. I, enlarged mine. The parameters are Objects Index #,X#,Y#, and Z#.
Position Object basically positions your object on the screen at a certain spot. Mines placed at the X of 0 (right in front of you) at the y of 0 (eye level) and just a little ways in front of you. So, parameters are index #,X,Y,Z
Make Camera 1 makes a camera and names it 1
Position Camera 1,0,0,0 Puts the camera on basically in the middle, right on the bottom of the level (unless you want to go into negatives) and right against the wall (again, unless you want to use negatives). This makes the camera look diretly at the object.
Rem just makes a remark and wont load the text that you type as a function or command
Remstart and remend - The text inbetween these two commands wont be used as commands either, just, remarks
Do - This command starts the cycle of what the prog will run through everytime it hits the loop. So, if you want to make something move forward by 1 everytime it cycles, this would be the command before move object 1,10 (moves your object of 1 10 world units away from you). Then, after that, you would put loop
If Upkey()=1 Then Dec Pitch#,3
This command makes it so that if you push the up arrow, then, the Pitch# is decrease by three. See, Dec Variable,Decrease by this number
So, subract 3 from Pitch is basically how that works
XRotate Object 1,Pitch#
This makes the object rotate around the X axis by a degree of the variable Pitch#
Same thing with the Inc Pitch#,3 This adds 3 to the Pitch#
YRotate Object 1,Roll# just basically Rotates the object along the Y axis by the number of the variable Pitch#
Then you got that freakin sync command again, which, just tells it to refresh the screen. This Do/Loop process will be ran 30 times a second
Hope you liked my little tutorial and found it usefull
Your suffering cause of me its divine
-Korn-