Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Code explanation?

Author
Message
Vandetta
23
Years of Service
User Offline
Joined: 17th Dec 2002
Location:
Posted: 28th Apr 2003 07:59
Hi Im really new to darkbasicpro and was wondering if someone could help explain the following code to me?

I understand everything until the autocam part, what exactly is autocam?

Also whats the 0 for after cls?

then whats making mesh from object do, what exactly is a mesh, why do they use it here and why do the delete it right afterwards? object 100 is the mesh that was just created right?

whats all the limb stuff about how does it all work and why are they using it?

the position camera stuff is all pretty self explanatory but how does there doesnt seem to be a number to determine the camera's direction just position, how does it know the right way to face?

the plain part for the background is pretty self explanatory

then I really dont understand the stuff inside the main loop except for fastsync and control camera using arrow keys

Thanks a lot for lending a hand.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Apr 2003 08:14
autocam - by default DBPro will reposition the camera to view the last created object. autocam off switches this off.

cls - you can specify a colour to clear the screen to. 0 is black.

mesh - The points/structure or 'shape' that makes up an object. An object is made up from a mesh, plus texture, position and rotation. This is just a quick way to get the object 'shape' for the later 'add limb' commands.

limb - several meshes can be joined onto an object to create a more complex object. They can also be individually rotated and positioned in relation to that object.

Phew! I hope that all the 3D stuff is right.
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 28th Apr 2003 08:17
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Apr 2003 08:28
Not bad seeing as it's 5:25am here. I'm just passing time trying to stay awake until I can go home to bed.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 28th Apr 2003 08:30
... the autocam when on also sets the perspective scale for the scene based on the first object (DirectX thing not a DB thing)

if you're used to any modeling packages you'll understand what i mean as standardly DB's perspective is pretty long making things look relatively well shaped (like in gmax) ... however you make a small object with the autocam and the perspecitve is set to that depth, so you make an object 10.0 in size and you're perspective range is now (2^10.0) which makes everything look like its stretched in the distance (like Milkshape)

i mean isn't really important, but something to bare in mind for later when everything is looking weird

as for the stuff in the loop
->


all that does is spin the object in an infinity pattern
so rotates in a circle using the Y axis (centre one) but at the same time the first loop it rotates over its left, then the next over its right. if that makes any sense?
just imagine that is is moving in a big 8 on its side ... we then add the rotation around and thats the effect your seeing.

values are wrapped to make sure they never go over 360°

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Apr 2003 08:34
Hmm, completely OT, but how did you get that degree symbol?
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 28th Apr 2003 08:57
open notepad

hold alt and the numbers 0 1 8 6 rapidly


or just check your character map and look in the font verdana to see an example

5th row 6th from the end

IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Apr 2003 09:01
º

Cool. Works in this message box too
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 28th Apr 2003 09:20
Shadow
23
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 28th Apr 2003 13:05
or hold alt and the numbers 0 1 8 6 slowlyº
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 28th Apr 2003 13:59 Edited at: 28th Apr 2003 14:00
or hold alt, press 0 and then press the down cursor many many times (about 186 should do it lol)

wanna know the weird thing... ° is Alt+0176 for me

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?

Login to post a reply

Server time is: 2026-07-11 22:24:56
Your offset time is: 2026-07-11 22:24:56