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 / 2 cameras 2 viewports

Author
Message
Jason Leigh
23
Years of Service
User Offline
Joined: 7th May 2003
Location: United States
Posted: 8th May 2003 01:53
Does anyone have a demo program showing the creation of 2 cameras with 2 separate viewports in 1 window, looking at the same scene?

I can't for the life of me get this to work.

Here's the code I am trying to make work:

set window layout 1,0,0
set window size 400,200

sync on

make camera 1
make camera 2

set camera view 1,0,0,200,200
set camera view 2,200,0,400,200

point camera 1,0,0,0
point camera 2,1,0,0
position camera 1,0,0,10
position camera 2,1,0,10

make object box 1,1,1,1
position object 1,0,0,0

do

y=y+1
rotate object 1,0,y,0

set current camera 1
sync
set current camera 2
sync
loop
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 8th May 2003 01:56
I've included the test program for my game (which has two cameras) - you wont be able to run it because its a test program for my game, but its got two cameras (actually pointing in the opposite direction, but thats easy enough to change).

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th May 2003 02:20
You don't want to create 2 camera - you already have one by default.

Try just setting the viewport for camera 0 and creating camera 1, and see if that does the job.
APEXnow
Retired Moderator
23
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 8th May 2003 02:20
I'm probably wrong but do you need to turn Autocam Off and reposition the cameras so they are not inside the cube, yes I know the cameras reposition automatically but is it that the cameras don't show the cube correctly, or at all?

"Man who looses key to woman's appartment...... He get no nookie" - A wise chinese man.
Jason Leigh
23
Years of Service
User Offline
Joined: 7th May 2003
Location: United States
Posted: 8th May 2003 07:15
Thanks everyone.
Turns out a combination of things had to be done:

- reuse camera 0
- make sure both camera 0 and 1 are current
- set position of a camera before doing the point-at
- coloring both backdrops to the same color

Still there is one issue left. I can't seem to make rightmost viewport correctly stretch to the end of the screen. I suspect it has something to do with the DarkBASIC logo that is floating on the side. Does this logo disappear in the full version?

Thanks again
Neophyte
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 8th May 2003 08:03
@Jason Leigh

" Does this logo disappear in the full version?"

Yes.

The Wendigo
23
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 8th May 2003 08:27
I got full version and I don't have any logos

Current Projects: mini BSP maker 50%, Height Mapper with many features 75%, FPS/RTT Nameless at the moment 15%

Login to post a reply

Server time is: 2026-07-11 00:36:17
Your offset time is: 2026-07-11 00:36:17