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 / do i need an object to move camera?

Author
Message
Double Dimension
16
Years of Service
User Offline
Joined: 16th Jun 2010
Location: United States
Posted: 18th Jul 2010 01:02
my camera doesn't move maybe because of my array's

Endurance Patience Thought Games are
Imagination experienced all around. and manipulated by an controller.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Jul 2010 01:26
You don't need an object to move your camera - and arrays are unlikely to be the problem.

Here's a simple template I often use when starting a new project. Move the camera back and forth with the up/down keys or turn the camera using the mouse. The only reason for the object (a cube) is so the camera has something to look at.

Double Dimension
16
Years of Service
User Offline
Joined: 16th Jun 2010
Location: United States
Posted: 18th Jul 2010 01:33
thankyou green gandalf

Endurance Patience Thought Games are
Imagination experienced all around. and manipulated by an controller.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 19th Jul 2010 16:20
And you really don't even need an object to set the lookat.

The fastest code is the code never written.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Jul 2010 16:27
True - but how would you tell whether the camera really was moving if it didn't have anything to look at?
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 19th Jul 2010 17:20
If I want something like a fly-through camera, I simply keep track of the look-at position. I calculate the camera position using:
the globals

and this function (for rotation only. code for movement dependant on how you want to move, but the camera's lookat is moved using that and the camera follows)


The fastest code is the code never written.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 19th Jul 2010 17:23
It might be that your sync is not working until you add a 3D object. To actually start up the 3D engine, I'm sure you need something 3D, then it knows that it has a camera and it's 3D. If you use only standard 2D commands, then the engine will stay 2D.

Sprites though, well they just puzzle me, I think they keep the engine 2D, but they are 3D objects - so I'm thinking there's a trigger whenever you create or load an object, which switches the camera update on.


Health, Ammo, and bacon and eggs!
Double Dimension
16
Years of Service
User Offline
Joined: 16th Jun 2010
Location: United States
Posted: 23rd Jul 2010 17:18
thank you every body i found my problem after undoing and redoing also using the rems and ` symbol to erase and cover over new and old functions and dims to find the problems. thank you for all your help and patience.

Endurance Patience Thought Games are
Imagination experienced all around. and manipulated by an controller.

Login to post a reply

Server time is: 2026-07-25 05:32:44
Your offset time is: 2026-07-25 05:32:44