CameraProjMode

BlitzMax Forums/MiniB3D Module/CameraProjMode

klepto2(Posted 2008) [#1]
Well nothing great, but a small addition to the functionset.
It enable the same cammodes as in b3d.

Replace the TCamera.bmx with this one :


And in functions.bmx under 'todo :
Replace the CameraProjMode Function ..
Function CameraProjMode(cam:TCamera,mode)
	Cam.CameraProjMode(mode)
End Function


And know the b3d manual sample translated to minib3d:

Import "minib3d.bmx"

Graphics3D 640,480
'SetBuffer BackBuffer()

camera:Tcamera=CreateCamera()
PositionEntity camera,0,0,-10

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

'; Create cube 1, near To camera
cube1=CreateCube()
EntityColor cube1,255,0,0
PositionEntity cube1,0,0,0

'; Create cube 2, same size as cube 1 but further away
cube2=CreateCube()
EntityColor cube2,0,255,0
PositionEntity cube2,5,5,5
Local mode:Int = 0
While Not KeyDown(KEY_ESCAPE)

'; If spacebar pressed Then change mode value
If KeyHit(KEY_SPACE)=True Then mode=mode+1 ; If mode=3 Then mode=0

'; If mode value = 2 (orthagraphic), Then reduce zoom value To 0.1
If mode=2 Then zoom#=0.1 Else zoom#=1

'; Set camera projection mode using mode value
CameraProjMode camera,mode

'; Set camera zoom using zoom value
CameraZoom camera,zoom#

RenderWorld

Text 0,0,"Press spacebar to change the camera project mode"
Text 0,20,"CameraProjMode camera,"+mode
Text 0,40,"CameraZoom camera,"+zoom#

Flip

Cls

Wend

End 


Maybe its useful for people writing editors and the like.


z4g0(Posted 2008) [#2]
thanks!!!!
I run to try it!


z4g0(Posted 2008) [#3]
wow! works really good!! ty!
Hoping that Simon will include this function fix in next releases!


simonh(Posted 2008) [#4]
Cool! Tested it and it works fine with CameraPick, CameraProject etc which is what I was worried about.

I will indeed add this to the next release - thanks klepto.


Shagwana(Posted 2008) [#5]
Awesome snippet this, just want to say that this mod is great!