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 / Make Camera?

Author
Message
B++
14
Years of Service
User Offline
Joined: 6th Dec 2009
Location: India
Posted: 1st Apr 2011 15:26
Hi,
Just a simple question. When I make camera 1, the program automatically set the view to camera 1 even if I set the current camera to 0. I only want to use the camera 1 for some small ingame cutscenes.
Thats why I am making the camera 1 in main loop and as soon as it finishes its job I am deleting the camera. Working fine but only problem is, the poly count becomes double. But it become normal again when the camera 1 get deleted and set the current camera to 0(the main player).
Any advice how do I do it?

Thanks in advance
Regards


Your Signature Here;
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st Apr 2011 16:26
I think you'll have to use "sync mask".



...will draw only to camera 0...



...will draw to camera 0 and camera 1

Decimal:
1 = Mask required to render camera 0 only
2 = Mask required to render camera 1 only
4 = Mask required to render camera 2 only
8 = Mask required to render camera 3 only
16 = Mask required to render camera 4 only
17 = Mask required to render camera 1 and camera 4

That should help I think.

Here's a great link for understanding "sync mask":
http://forum.thegamecreators.com/?m=forum_view&t=163543&b=1

B++
14
Years of Service
User Offline
Joined: 6th Dec 2009
Location: India
Posted: 1st Apr 2011 17:28
I think I don't understand it. How do I use it? I have a variable and when it is 0 I want to set the current camera 0 and when it is 1 I want to set the camera 1. I don't want to render 2 camera at a time.
Thanks for your reply.

Regards


Your Signature Here;
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st Apr 2011 17:44
OK so:


...or:


B++
14
Years of Service
User Offline
Joined: 6th Dec 2009
Location: India
Posted: 2nd Apr 2011 07:48
Sorry baxslash, I could not reply yesterday bcos of my connection problem.
I could not make it work. Now it does not even change the camera and I just get a blink bfor finishing the cutscene time.

Regards


Your Signature Here;
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 2nd Apr 2011 16:50
Maybe my code is not quite right then. Could you post some sample code of your problem?

It might help in debugging it.

B++
14
Years of Service
User Offline
Joined: 6th Dec 2009
Location: India
Posted: 2nd Apr 2011 20:50 Edited at: 2nd Apr 2011 20:58
My code is very simple. I am making the camera 1(when I create it, program automatically set the camera to 1, which is ok). Then I run a timer or variable for the cutscene and when it is greater then some value I delete the camera 1 and set the current camera to 0. Thats it.

Say, cutscene is the variable for running the cutscene. If it is 0 then player can move and if it is 1 than the above condition runs and player can't move.

Here is the function.


EDIT: Now I am thinking, why camera 1. When I can use the camera 0 in stead of camera 1.

Thanks in advance
Regards


Your Signature Here;
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 2nd Apr 2011 22:37
Unless you need to have 2 different views at the same time, or are doing some shader trickery, there is really no need (IMO) to have more than the standard camera.

If you have a cut-scene, simply save the camera coordinates and angles, then reposition the camera appropriately. Then when you are done, used the saved values to put it back into its original position.

B++
14
Years of Service
User Offline
Joined: 6th Dec 2009
Location: India
Posted: 2nd Apr 2011 22:50
Thanks IanM. I just realized that after posting the above post. I changed my code and it is working fine.

Regards


Your Signature Here;

Login to post a reply

Server time is: 2024-11-16 19:13:50
Your offset time is: 2024-11-16 19:13:50