Jump to content

Recommended Posts

Posted

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!

Posted

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

Posted

is this the best way to do this? I dont think so. when I play a game and see 2 or more views in one window or just take a look into leadwerks 4 views. this are just textures ???

It doesn´t work... why? mhmmm It works... why?

Posted

Absolutely--rendering rear view mirrors and such to a texture, and then displaying that on geometry in the main view, is how it's done. Trust me--I've worked on racing simulators since 2005 :)

--"There is no spoon"

Posted

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!

Posted

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!

Posted

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.

Posted

Wouldn't this also be possible with multiple camera's? It seems like an adventage to use the camera object in your scene for this. Not only do you have a proper debug view for the camera rotation and alignment, you can also set specific shaders or post effects on that camera.

Posted

I guess, haven't tried, just hide your context camera and show your rearview camera and vice versa, just don't have both active at the same time when render is called.

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

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

×
×
  • Create New...