cameraviewport problem

Blitz3D Forums/Blitz3D Programming/cameraviewport problem

i have a main camera and a mini view camera, they both work fine using the sample code below

cam1 = createcamera()
cameraviewport cam1,0,0,GraphicsWidth(),GraphicsHeight()

cam2 = createcamera()
cameraviewport cam1,0,0,GraphicsWidth()/3,GraphicsHeight()/3

now the problem comes when i parent my cam2 to another entity ie

cam2 = createcamera(parententity)
cameraviewport cam1,0,0,GraphicsWidth()/3,GraphicsHeight()/3

or entityparent cam2,parententity

the viewport stops showing up.
am i doing something wrong ?



EDIT: typo fixed :p

There is a comma missing before Graphics...

no thats not it, just a typo when i posted :)

Well in the first one you set the cameraviewport for camera 1 twice and not at all for camera 2.

You need to create the parent pivot AFTER the first camera. If you create before the first camera will overdraw the second one.

Seems to be a bug. Probably has something to do with the order in which Blitz3D handles objects internally.

Kind regards
Reda Borchardt

typo's again(i was just copy and pasting), im tired.

@Reda, that's what i thought too. yep looks like a bug.

thanks, it works now.

You can also use EntityOrder to render the second camera last, ie. EntityOrder cam2,-1

That works as well...
Fredborg