cameraviewport problem

Blitz3D Forums/Blitz3D Programming/cameraviewport problem

(tu) sinu(Posted 2003) [#1]
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


Reda Borchardt(Posted 2003) [#2]
There is a comma missing before Graphics...


(tu) sinu(Posted 2003) [#3]
no thats not it, just a typo when i posted :)


Gabriel(Posted 2003) [#4]
Well in the first one you set the cameraviewport for camera 1 twice and not at all for camera 2.


Reda Borchardt(Posted 2003) [#5]
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


(tu) sinu(Posted 2003) [#6]
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.


fredborg(Posted 2003) [#7]
You can also use EntityOrder to render the second camera last, ie. EntityOrder cam2,-1

That works as well...
Fredborg