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.

Code Snippets / Camera and object movement. DBP

Author
Message
YAURAH
17
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Everywhere
Posted: 25th Apr 2007 20:50
Here is a code to help those who want to understand camera and object movement commands..its very basic...in fact its DARK Basic...





CSJ 7000
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 26th Apr 2007 00:01
Quote: "Here is a code to help those who want to understand camera and object movement commands..its very basic..."


Hmmm... yes it is.

The idea of this board is to post helpful code snippets which benefit others, covering things that can't be gleaned in a few minutes from the help files.

More importantly, I think your snippet might confuse beginners - it did me and I've been out of beginner status a while:

Quote: "turn off the autocam, then make your own freecam"


What's are 'autocams' and 'freecams'? The default camera does everything a camera you create can do, so why do you create camera 1?

Quote: "position object 1, 0, 0, 0"


It's already there when you create it, so if you aren't using position variables or need it to be somewhere other than 0,0,0 it's not necessary to position it.

Quote: "key control using w,a,s,d"


W and S keys do nothing.

Extraneous code:



Better:



These are admittedly minor points but do add to the confusion if you are a beginner.

The biggest problem of all though is that the snippet doesn't do what it says it does - or I misunderstand the exercise completely and it does - but does something so strange that I can't imagine anyone ever having a use for. (I'm happy to take it back if anyone can suggest a use for it).

Quote: "key control using w,a,s,d to make the cube object and the camera follow in the same motion"


When you run the program, if you use the Z key, the camera continues despite the cube stopping at the spheres. Reversing back doesn't get the cube back.

Sorry - I just don't get it!

TDK_Man

YAURAH
17
Years of Service
User Offline
Joined: 12th Apr 2007
Location: Everywhere
Posted: 26th Apr 2007 03:26
thank you TDK, as I am a begginer to programming in Dark Basic, and just felt the need to post some quick help, as I needed it earlier and accomplished what I was trying.

CSJ 7000

Login to post a reply

Server time is: 2024-11-22 19:08:31
Your offset time is: 2024-11-22 19:08:31