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 / Problems with the SET CAMERA VIEW command

Author
Message
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 25th Jul 2003 07:01
Hello.

I have been trying to set up a two player split screen mode for my latest project, but I can't seem to get it working. Could anyone please help.

I tried the following in my code:

set display mode 800,600,16
make camera 1
if splitscreen=1
make camera 2
set camera view 1,0,0,800,300
set camera view 2,0,300,800,600
else
set camera view 0,0,800,600
endif

Whilst I would imagine that this would work, sadly, it doesn't I get unexpected results. I had thought the top left screen co-ordinate would be 0,0 but he results suggested otherwise, so I tried changeing the parameters in the 'set camera view' command to reflect screen co-ordinates of 0,0 in the bottom left but that wasn't right either.

So, I suppose I have two questions here:
1) What is the correct format to use SET CAMERA VIEW?
2) Where is the screens origin?

Any help would be greatly appreciated. Thank you
Nine lives to choose from and I get stuck with this one!
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 25th Jul 2003 07:02
P.S. how do you enter a code snippet into a thread?

Nine lives to choose from and I get stuck with this one!
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 25th Jul 2003 11:48
here you go i'm not sure why your code didn't work? but this does in pro.


notice how the views are set outside the main loop. the eaiest way is to use the code box underneath where you write your message so that a source tag come up below your posted message(see below)

You know whats weird???
Donald duck never wore pants, yet everything time he got out of the shower he put a towel around his waist...
Whats with that???
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 25th Jul 2003 19:40
Thanks red eye - that's great!

However, my 'position camera' command must go in the main loop because both cameras will be tracking the cars for players one and two - will that be a problem?

Nine lives to choose from and I get stuck with this one!
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 25th Jul 2003 21:52
nope, shouldn't cause a problem

You know whats weird???
Donald duck never wore pants, yet everything time he got out of the shower he put a towel around his waist...
Whats with that???
3dZmaster
21
Years of Service
User Offline
Joined: 30th Jun 2003
Location: Finland
Posted: 25th Jul 2003 22:32 Edited at: 25th Jul 2003 22:33
Well... This is off course a working code, but it will strecht the camera view. If you to it in your car game, it will look pretty funny. I have been facing this same prob and asked help and gained answers that tells me to put the both cameras viewports into images. Then Make sprites of the images and display them with the camera 0. However, I haven't managed to get this work. The problem is that the picture resolutions are so damn low and some other probs too... I wish someone could write that code for me. But don't think I'm some kind of newbie... I have made games and I can program well with DBpro, but the viewport thing is chinese to me. By the way, if you split the screen in four parts the problem wont appear cause the viewports are like "uniform scaled" into the specified location. So they are not streched... If anyone want to help me and Scraggle please write the code... Thanx

Current project: 3d demo to show my skills to other users
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 25th Jul 2003 23:10
Sorry... It just doesn't work!

set display mode 800,600,16
make camera 1
set camera view 1,0,0,800,600

As far as I can tell the last two lines of the above code should be pointless and I should still get a full screen view. But I only get about a third of the screen displayed along the bottom with the top two thirds being plain green(?).

OK I'm taking a step back now. Whilst I was writing this I had another look at Red eys's code and I noticed the line 'autocam off'. I don't kow what thiat does but is it maybe what is causing my problems?

Anyone?

Nine lives to choose from and I get stuck with this one!
3dZmaster
21
Years of Service
User Offline
Joined: 30th Jun 2003
Location: Finland
Posted: 25th Jul 2003 23:14
Autocam is on if not setted of. When autocam is on the camera positions itself to object if you create one. That doesn't have effection on your code.

Current project: 3d demo to show my skills to other users
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 25th Jul 2003 23:26
my code works, right? the green is the second camera(camera 1) showing its view, green is the default backdrop it seems, if you take out the 2 color backdrop commands in my code you'll notice how the bottom half is green thats the second camera backdrop color, maybe post your code and i'll play around with it to see if i can get it right. it could be that. i tried to get the problem you have but can't i used the exact same code, do you have the latest version of dbp(4.1)

You know whats weird???
Donald duck never wore pants, yet everything time he got out of the shower he put a towel around his waist...
Whats with that???
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 26th Jul 2003 07:20
Yes your code works fine - I'm confused
I'm not really doing anything diferent but it isn't working.
I will post the code here when I get back from work (in about 13 hrs)and you can look at it if you like and see what ou think.

Nine lives to choose from and I get stuck with this one!
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 26th Jul 2003 20:30
OK, I have cut down my code to just the barebones of the display.
The variable 'splitscreen' is set to 1 which should give a splitscreen appearance if set to 0 then it should become full screen.
Unfortunately I can't get it to work correctly. If anyone could find the time to have a look at it and maybe let me know where I have gone wrong I would very much appreciate it.

Thank you

Nine lives to choose from and I get stuck with this one!
3dZmaster
21
Years of Service
User Offline
Joined: 30th Jun 2003
Location: Finland
Posted: 26th Jul 2003 20:59
Ok. You used the set camera range wrong. This is the working code with rems in the fixed parts. Read them carefully.

Ask if somethings wrong or smthing...

Current project: 3d demo to show my skills to other users
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 27th Jul 2003 06:48
Thank you, thank you, thank you.
3dz you are a star!
Now that you have pointed it out it is so obvious but I just couldn't see it.
Thank you

Nine lives to choose from and I get stuck with this one!

Login to post a reply

Server time is: 2024-09-20 17:41:34
Your offset time is: 2024-09-20 17:41:34