Main Menu

camera issues

Started by BlinkOk, November 26, 2015, 09:05:00 PM

Previous topic - Next topic

BlinkOk

trying to get the camera thingy working. in my proggy i have a background that is drawn and then everything on top of that.
when i use the camera all i see is the background. i rigged up a demo so you could see. it's the camera example with a big image plopped at the front.
it's interesting coz the image/circle rendered BEFORE the background image you can see, but nothing afterwards. i did try the camerascenesort command without success


kevin


you need to tell it what Z depth captured draw requests bellow to via Capturedepth, otherwise they'll all be at the same depth and at the mercy of the  sort order.

BlinkOk

it really should mimick the natural screen drawing. it makes it almost impossible to implement a camera after work has been done

kevin

but  if it mimicked the execution order there's no point in using a camera to draw a scene.


BlinkOk

all i wanted to do was add a shake to the scene.
i had already coded all the drawimage commands so i though great, add a camera and move it back and forward a bit.
i add the camera and everything is written at a different depth. i have to go back and convert all the draw commands to a function that adds a z depth
huge pain in the arse

kevin


  declare some axis offset variables/or structure whatever, wrap the draw image function then search and replace in the drawimage commands.   

PlayBASIC Code: [Select]
 globals OffsetX#,OffsetY#

etc
Psub DrawI(ThisImage,X#,Y#,TransparentFlag)
X#+=OffsetX#
Y#+=OffsetY#
DrawImage ThisImage,X,Y,TransparentFlag
endpsub



stevmjon

hey dude

I assume you have fixed the problem already, but I added in capturedepth to the code for others to see that are interested, to compare to the first post.
just a quick alteration but it works.

stevmjon
It's easy to start a program, but harder to finish it...

I think that means i am getting old and get side tracked too easy.

BlinkOk

#7
Quotedeclare some axis offset variables/or structure whatever, wrap the draw image function then search and replace in the drawimage commands.
does not work if i need to shake the screen after half of it is drawn

what i did worked.

it's just that any logical person is going to assume that drawing to ANY surface is going to occur in the same manor BY DEFAULT. So if i want to change the z depth i use the commands but BY default is should draw to the screen in the same fashion that it draws to a scene or bitmap. In fact i should be able to alter the z depth while i'm drawing to the screen as well