Jump to content

Managing multiple cameras


Chiblue
 Share

Recommended Posts

I am working on building a 3rd Person Perspective into my project, I also want to have the ability to a overhead "birds view" camera option... So is it best to use a single camera and move it around to were you want it to shoot from, or is it better to run multiple camera and then activate or de-activate the one that is to be used...

 

Oh and by the way, if multiple cameras are the way to go how do I activate a different camera using the same scene?

If it's not Tactical realism then you are just playing..

Link to comment
Share on other sites

I think what people do is use 1 camera. Position it in the top down view each frame, but render what it sees to a different buffer. Then bring it back to the 3rd person. Now you can draw that other buff on the screen. So you'd be rendering the world twice each iteration. Once to the top/down buffer and then the normal on to the gbuffer that gets flipped onto the screen.

Link to comment
Share on other sites

I tried that but my FPS drops from 300+ to 20-...

 

Is the code small enough that you could show us. I wouldn't think it would matter to use 1 or 2 cameras though. I did something like this for a player HUD. Where I would place the camera directly in front of the player, place an inverted cube around the player and camera to give a black background, then render that to a buffer and draw it screen using DrawImage(). It would when snap back to where it was. I didn't notice any drop in FPS with that.

Link to comment
Share on other sites

I am not sure if the drop in fps was due to single camera or not, I did get the 1st and 3rd person working with 1 camera which did involve lots of show and hide entr

entity for the different objects, I will look at this again today and if I still have issues will post the code. Thanks for the show hide entity for cameras that is helpfull...

If it's not Tactical realism then you are just playing..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...