2D/Flat Camera

BlitzMax Forums/MiniB3D Module/2D/Flat Camera

daaan(Posted 2007) [#1]
Is it possible to change the perspective on the camera to make it render in a 2D/Flat way? I know that the cameraprojectionmode function is not yet implemented, but is there another way?

Thanks.


LAB[au](Posted 2007) [#2]
You will have to manually change the OpenGL projection ... somewhere in Minib3d I guess ...

glOrtho(-1.0, 1.0, -1.0, 1.0, 5, 100)
glMatrixMode(GL_MODELVIEW)

to replace

glFrustum(-1.0, 1.0, -1.0, 1.0, 5, 100)
glMatrixMode(GL_PROJECTION)

look for these 2 ones in minib3d code.

(as minib3d is written in bmax and opensource, there is always a way!)


daaan(Posted 2007) [#3]
Yeash I've spent near twenty minutes looking for it and I'm not seeing either function. Hopefully Simon will be able to help me out! or someone!?


LAB[au](Posted 2007) [#4]
in TCamera.bmx -> Method accFrustum

Experiment with a copy of minib3d ...

Took me 2' to find it ... ;)


Difference(Posted 2007) [#5]
Are you looking for this maybe? :
http://blitzbasic.com/Community/posts.php?topic=67884#758428


daaan(Posted 2007) [#6]
@Peter - Thanks, but that's not what I'm looking for. I want the perspective of the camera to be flat... or I mean have no perspective.

@LAB - I'll see what I can find.


Difference(Posted 2007) [#7]
@danjw: I thought that's what the code does:
in this example I stole some code from brls graphics to enable orthographic "mode" (ie non perspective)


I'm guessing it should be fitted in somewhere in miniB3Ds Tcamera type , Method Update() to work?


daaan(Posted 2007) [#8]
Man.. I've no clue what I'm doing. The Method Update() is neutrally commented out and when I tinker with other stuff it just makes it worse.. Ugh.


daaan(Posted 2007) [#9]
I can't get it to work. I guess I'll come back to it later. There has to be an easier way of doing this though. Blah.