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.

Dark GDK / Showing Multiple Cameras?

Author
Message
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 3rd Oct 2008 00:07
How do I show multiple camera views on the screen by dividing up the screen? I would like to show multiple perspectives of the same object/scene.

As always:
- A code snippet would be nice
- Please check back if you post if I have question.


Thanks Much
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Oct 2008 00:51
Check the help for dbSetCameraView(). You can use that command on any camera, including the default camera (camera zero).

ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 3rd Oct 2008 01:05
I want all the 4 camera to be visible on the screen by splitting the screen up into four squares.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Oct 2008 01:16
Ok, so check the help for dbSetCameraView().

Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 3rd Oct 2008 01:17 Edited at: 3rd Oct 2008 01:18
Speaking of this - IanM, is it possible to set the render target of a camera or something to a texture on an object? Think of, like, a security camera thing.

Edit: Durr.

Quote: "dbSetCameraToImage
This command will direct all camera output to the specified image. This command is ideal for performing the fastest method of creating textured polygons that show a different view within your 3D world. You can use this command to create mirrors, security cameras within your game or dynamically moving the camera view around on a polygon shape such as a floating panel.
"


I guess so.
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 3rd Oct 2008 01:27
Quote: "void dbSetCameraView ( int iCamera, float fLeft, float fTop, float fRight, float fBottom ) "


What values should I generally give them? I tried a few but I made the screen compleltly black.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 3rd Oct 2008 01:29
int iCamera = camera's id
float fLeft = view position x on screen
float fTop = view position y on screen
float fRight = view's lower right corner's position x on screen
float fBottom = view's lower right corner's position y on screen
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 3rd Oct 2008 01:33
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 3rd Oct 2008 01:48
Quote: "+ Code Snippet

dbMakeCamera(1);
dbMakeCamera(2);
dbMakeCamera(3);

dbSetCameraView(0, 0, dbScreenWidth()/2, dbScreenHeight()/2);
dbSetCameraView(1, dbScreenWidth()/2, 0, dbScreenWidth(), dbScreenHeight()/2);
dbSetCameraView(2, 0, dbScreenHeight()/2, 0, dbScreenHeight());
dbSetCameraView(3, dbScreenWidth()/2, dbScreenHeight()/2, dbScreenWidth(), dbScreenHeight());
"


How about the bottom left? That piece of the screen was compelelty black.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 3rd Oct 2008 01:50
Bottom Left? Uh... That should be camera 2. I don't see anything wrong.
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 3rd Oct 2008 02:00
Quote: "Bottom Left? Uh... That should be camera 2. I don't see anything wrong. "


Thats weird. I guess its just mine thats going black.

Is there are formula for placing the cameras like you did?
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 3rd Oct 2008 02:04
Uh, what?
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 3rd Oct 2008 02:05
Is there a particular method that you used to place the camera in the screen?
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 3rd Oct 2008 02:27
Try dbPositionCamera?

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 3rd Oct 2008 09:58 Edited at: 3rd Oct 2008 09:58
Quote: "Try dbPositionCamera?"


I think he meant the viewport of the camera.

Quote: "Is there a particular method that you used to place the camera in the screen? "


Math...splitting a screen into 4 equal boxes is the screen dimensions(width and height) divided by 2.

Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 3rd Oct 2008 12:40
Slayer93 - Isn't that Zuka answer?

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Slayer93
20
Years of Service
User Offline
Joined: 5th Aug 2004
Location: I wish I knew
Posted: 3rd Oct 2008 21:36
Yeah but it looked like he was getting confused on how he was placing the camera's viewports...

or maybe I'm confused

ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 4th Oct 2008 22:42
I've got it now. He just divided up the screen into the number of panels. Thanks guys
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 5th Oct 2008 02:31
By the way, if I were you, I would add this:



Makes black lines separating the panels. It just looks better.
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 5th Oct 2008 02:48
Quote: "By the way, if I were you, I would add this:

+ Code Snippet

dbInk(0,0);
dbLine(0, dbScreenHeight()/2, dbScreenWidth(), dbScreenHeight()/2);
dbLine(dbScreenWidth()/2, 0, dbScreenWidth()/2, dbScreenHeight());



Makes black lines separating the panels. It just looks better. "


Thanks Zuka

Login to post a reply

Server time is: 2024-11-25 03:27:51
Your offset time is: 2024-11-25 03:27:51