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 / using viewports!?

Author
Message
someone namedlink
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: Dream Planet
Posted: 4th May 2005 19:40
hello,

I wanted to know if I can use viewports and how to use them. I want to show a 3D world on a certain part of the screen and the rest of the screen is 2D. I hope someone can help me,

someonenamedlink

DIV/DBP-coder
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th May 2005 19:54 Edited at: 4th May 2005 19:55
Have you tried pressing the F1 key and looking throught the help file in the camera's section?

EDIT:
Btw: Yes, you can use multiple camera. I used them to pretty good effect for a 4 player maze game called Primitive Maze which is in my DBP Projects section of my website.

My Website:
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th May 2005 20:05
You could just use:

SET CAMERA VIEW xa,ya,xb,yb

This will set a rectangular area of screen as the 3D view and any 2D outside of it will be left alone.

You should look into the SET SCREEN RATIO command as well, because you have to set the ratio to your new settings so that things don't get distorted. I think the ratio is just the width divided by the height (of the camera view I mean).


Van-B

Quote: "How could I condescend you?, you don't even know what it means!"

Van-B's mom.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th May 2005 20:39
@Van B: Is there not a camera number arguement to that command too?

I knew that was the command - just couldn't rememebr the precise wording or details, but I dot know that the manual DOES know.. Hence the F1 suggestion.

My Website:
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th May 2005 20:49
Nah, that's just the 3D view - I don't think you can use more than one camera output on the physical screen (that would make things far too convenient, and Lee can't have that ).


Van-B

Quote: "How could I condescend you?, you don't even know what it means!"

Van-B's mom.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th May 2005 21:30
you can - i have done it.. Check out my Primitive Maze game on my site..

It uses 4 viewports to 1 screen (each viewport is a camera)...

My Website:
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th May 2005 21:40
Ahh, did'nt know that!

I'm kinda avoiding extra cameras until we have more control over them, but for multiple viewports they would be less hassle than using buffer bitmaps etc.


Van-B

Quote: "How could I condescend you?, you don't even know what it means!"

Van-B's mom.
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 4th May 2005 21:48
What are we missing in terms of control over multiple cameras? Since Mike fixed the remaining multi-camera bugs in v5.8, we've got as much control with them as we have with the default camera.

This is great. I'm currently amusing myself creating HUDs where multi-cameras are used to display things like missile warhead view in a small HUD window inside the main window. All VERY cool.

The only functionality I could think of that we don't have is the ability to only render certain objects on certain cameras. Mike has said he might have a think about this for future versions of DBPro.

Philip

Cheer if you like bears! Vote Conservative and save the Country!
P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 4th May 2005 22:17
Multiple cameras absolutely ROCK!

By far DBPro's best command is set camera to image - perfect for making live TV screens รก la HL2.

My Showcase - It's DBpro-tastic
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th May 2005 22:23
The annoying thing about cameras for me is the way you can't lock an object to a specific camera, if you lock a target reticule object onto your main camera, it's on every other camera you create as well.

Unless of course they've changed that - I'm not using 5.8 very much right now.


Van-B

Quote: "How could I condescend you?, you don't even know what it means!"

Van-B's mom.
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 4th May 2005 22:35
Why not just make your own simple function that points the camera at the specified object? Or just use point camera?

My Website:
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 4th May 2005 22:53
I mean for object that you lock onto the screen, with LOCK OBJECT ON. I imagine that I could work around it, but I still remember the pain in trying to get my sniper scope in OIE, like an object on the main camera textured with the results of an extra cam. The slowdown did'nt help much, but I eventually just scrapped it as a bad idea.

I'd probably only use extra cams for TV screens like Chris, like a monitor with a videa camera output being broadcast live. Personally I think the ability to manually sync any camera would make things much easier - like you would'nt suffer the performance hit unless you sync'd the other cameras as well, so if you had 5 cameras you could update one per loop, or less if you like. For things like monitor screens, there's little point updating the camera until the player is in front of the screen watching it.


Van-B

Quote: "How could I condescend you?, you don't even know what it means!"

Van-B's mom.
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 5th May 2005 01:34
Er ... VanB, mate, why are you using the lock object on command for this?

In this scenario your better bet for this would be each loop to do a pick screen for the centre of the screen. Then return the real world coordinates by adding the vector produced to the camera's XYZ worldspace position. Then position the target recticle plane at that position, then set object to camera orientation, then turn the plane right or left 180.

Voila!

A bit more computationally expensive per loop, but a lot more flexible.

Philip

Cheer if you like bears! Vote Conservative and save the Country!
P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 5th May 2005 04:36 Edited at: 5th May 2005 04:37
With set camera to image you only really need a resolution of 64x64 or 128x128 for a TV screen. This means it's very very fast.

What you want to do is only update the texture when the user is near the screen.

My Showcase - It's DBpro-tastic

Login to post a reply

Server time is: 2025-05-29 10:32:22
Your offset time is: 2025-05-29 10:32:22