Camera window

Blitz3D Forums/Blitz3D Programming/Camera window

Hi, all
I am looking for a way to have a second 3D window within the main 3D window of my game. This is because I need to display a second camera top view to show a mini map
Any help?

EDIT: I forgot to mention that I want to have this window anywhere on the screen and not only to the upper left corner

You could maybe use CameraViewPort. The z-order is determined by the order the camera's are created.

CameraViewport command?

http://www.blitzbasic.com/b3ddocs/command.php?name=CameraViewport&ref=3d_cat

Thanks guys, but with this simple method you can have a minimap ONLY to the UPPER LEFT corner.
Is it possible for example to move the second view to the UPPER RIGHT corner?
Probably I could render the output of this camera to a memory buffer and then place this buffer anywhere on the screen, but before try I wanted to know if this is a slow process...

For this, you can use the x/y parameter of the command:
; CameraViewport Example
; ----------------------

Graphics3D 640,480
SetBuffer BackBuffer()

; Create first camera
cam1=CreateCamera()

; Set the first camera's viewport so that it fills the top half of the  camera
CameraViewport cam1,GraphicsWidth()/2,0,GraphicsWidth()/2,GraphicsHeight()/2

; Create second camera
cam2=CreateCamera()

; Set the second camera's viewport so that it fills the bottom half of the  camera
CameraViewport cam2,0,GraphicsHeight()/2,GraphicsWidth(),GraphicsHeight()/2

light=CreateLight()
RotateEntity light,90,0,0

plane=CreatePlane()
grass_tex=LoadTexture( "media/mossyground.bmp" )
EntityTexture plane,grass_tex
PositionEntity plane,0,-1,0

While Not KeyDown( 1 )

If KeyDown( 205 )=True Then TurnEntity cam1,0,-1,0
If KeyDown( 203 )=True Then TurnEntity cam1,0,1,0
If KeyDown( 208 )=True Then MoveEntity cam1,0,0,-0.05
If KeyDown( 200 )=True Then MoveEntity cam1,0,0,0.05

RenderWorld

Text 0,0,"Use cursor keys to move the first camera about the infinite plane"

Flip

Wend

End


Oops!
Thanks b32.
My question was so stupid. I felt like an idiot when I checked you code...

..you dont have reason to feel stupid Moraldi...you should see me and my stupidity feeling every day i see wheels around and asking myself how i missed such a thing to develop and put patent over it :)