Jump to content

Multiple Cameras displaying on screen


xtreampb
 Share

Recommended Posts

So lets say i wanted to do a racing game and have a 'rear view mirror' on the screen. I would use a second camera right. So how would I display the image over the first.

 

Also Lets say i wanted to put 2 views side by side. A top down and a 3d perspective, similar to the editor. How do I display the multiple views?

 

This can be either LE 2.5 or 3.x

 

Thanks in advance

 

~Xtreampb~

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Link to comment
Share on other sites

You move the camera where you want and call world->render() which renders to a texture using a buffer.

You can draw the texture using drawimage or on a 3d object as a texture.

There should be a lua example on the wiki somewhere.

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

what about if i wanted to do this in C++? Is there a tutorial or the like on the wiki?

 

EDIT:

 

Disregard i'm an idiot after work.

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Link to comment
Share on other sites

Thanks a lot shad. I understand that flow a lot better for some reason. This displays what my main camera is looking at. What i'm wanting is a way to draw a second camrea view on the same window, not a duplicate of my current camera. How do i change which camera i pull my image from. Would i create a second camera, disable my first, enable the buffer, render, disable camera, enable main camera, switch context, get material, render. Is that more or less the proper procedure?

bool Life()
{
 while(death=false)
 {
   if(death==true)
   return death;
 }
}

 

I have found the secret to infinite life

 

Did I help you out? Like my post!

Link to comment
Share on other sites

You don't have 2 cameras. Instead in 1 frame you move your 1 existing camera to a point (you can define this location with a pivot or something), basically take a "screenshot" of what that camera sees, then move your camera back to it's original position (probably your FPS or something) and render that "screenshot" (buffer) to a texture that is part of a material already that is applied to some 3D object.

 

So the important thing to note is that you only have the 1 camera and you'll need some markers (pivots) to place that camera and take "pictures" all in one frame.

Link to comment
Share on other sites

  • 1 year later...

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...