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.

Newcomers DBPro Corner / camera help

Author
Message
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 19th Nov 2005 06:51
Is it possible to have the screen divided in half and have 2 seperate cameras being displayed at the same time? and is it possible to record what the camera is playing?

In the world, there are people that agree with me, and the ones that are wrong.
The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 20th Nov 2005 02:27 Edited at: 20th Nov 2005 02:45
Hi

Quote: " Is it possible to have the screen divided in half and have 2 seperate cameras being displayed at the same time?"

This depends on what Darkbasic version you have actually. if you have DarkBasic Classic, this in not possible as it don't have support for multiple camera's. But if you have DarkBasic Professional, then it's a hole other story! With DarkBasic Professional you can have multiple camera's.

I've just made a little example for you, showing how to divide the screen up into 2 screen. You can select between the 2 cameras and control them around.

Onto the code!:


Now i will explain how i did this.
First of all, we need to make a new camera. I do this by writing "make Camera camera number".
Now as you maybe know, the default camera in DarkBasic is 0, so we only need to make 1 new camera to have our two camera's ready.
Now right after we've made the new camera(1), we need to put it on the screen, so you can see it. I do this by writing "set camera view", followed by integers. The first two integers are the position of the screen, we want this camera to be the top camera on the screen, so we position it in the top left corner of the screen. The next thing i do is to strecth the camera view to fill the hole screen width, and then i divide the camera view with the screen height. Now the first camera is actually set up! Now we just need to set up the default camera(wich is 0). We use the same command for this("set camera view").

Next thing I do is to make an integer called "currentCamera". With this integer we can control wich camera to use. Try to study the rest of the code to see if you can figure out what it do Just ask if you need help to understand it

About the other question you had. I'm not sure that you can record the camera view.

-The Nerd

PanzerGameshere
Free Particle Engine For dbpro :
here
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 20th Nov 2005 04:11
thanks, really helped. I'm trying to make a two player zombie fighting game. Right now i'm doing it with different colored dots and blocks for walls and charectors but i'm going to do the models later. I need hellp with gravity though. I try to use some of the data from the tutorial but the gravity just isnt strong enough. I also need help with guns. I have a gun model but i load it and its a topview and the gun is at the bottom of my screen.

In the world, there are people that agree with me, and the ones that are wrong.
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 20th Nov 2005 04:18
oh yeah and is it possible for both of them to show at the same time?

In the world, there are people that agree with me, and the ones that are wrong.
MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 20th Nov 2005 04:27
I cant figure out whats wrong with this

it says "variable upkey name is not valid at line 3"

In the world, there are people that agree with me, and the ones that are wrong.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 20th Nov 2005 07:07
If upkey()=1

The error message says it all!

Don't forget F1 also...

TDK_Man

MMORPG programs
18
Years of Service
User Offline
Joined: 12th Nov 2005
Location:
Posted: 20th Nov 2005 21:54
oh.... right, the () heheh....

In the world, there are people that agree with me, and the ones that are wrong.

Login to post a reply

Server time is: 2024-09-24 09:37:08
Your offset time is: 2024-09-24 09:37:08