BasicGL for Blitz

Blitz3D Forums/Blitz3D Programming/BasicGL for Blitz

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I have been playing with the mirror demo. The 'ShadowPlane' was causing problems by reproducing the plane geometry. So I edited the shadow stuff out - the following looks really cool:
;###################################################################
;                                                              
;                 		Basic GL For BlitzBasic © 2004               
;  		Creator: Albert Khakimov (arkon)  arkon@...             
;  		Support: Korolyov Sergey (ventru) ventrual@...       					      
;  		Sample: Mirror                                              								      
;	  	Version: 0.1                                              									    						
; 	 	Date: 18.11.04                        
;                      									                        										
;###################################################################
;
; Edited by "puki"
;
;###################################################################

Include "../../Constants.bb"
Include "../../KeyCodes.bb"

Global Camera, CameraPV, Light
Global Mirror, Torus, Plane, Ex  


;3d graphics initialization
gInitGraphics(640, 480, 32, 0, 0)

;S C E N E
;------------------------------------------------------------------------
gAmbientColor 0.2, 0.2, 0.1
gBackColor 0.0, 0.1, 0.2
;Create Camera
CameraPV = gCreateDummy(0)
Camera = gDefaultCamera()
gSetPosition Camera, 0, 1, 3
gSetParent Camera, CameraPV
;Create Light
Light = gCreateLight(0)
gSetPosition Light, -1, 5, 1
;Create Torus
Torus = gCreateTorus(0)
gSetTargetObject Camera, Torus
;Create Plane
Plane = gCreatePlane(5, 5, 0)
gLoadObjectTexture Plane, "..\..\media\back1.jpg"
gPlaneTiles Plane, 5, 5
gSetAbsDir Plane, 0, 1, 0
gSetAbsPos Plane, 0, -2, 0
;Create Mirror
Mirror = gCreateMirror(3, 3, 0)
gSetAbsDir mirror, 0, 0, 1
gSetAbsPos mirror, 0, 0, -2.5
;gObjDiffuse mirror, 0, 0, 1, 0.8
gLoadObjectTexture mirror, "..\..\media\back2.jpg"
;Create Extrusion
Ex = gCreateExtrusion(mirror)
gObjDiffuse Ex, 1, 0.1, 0, 1
gExHeight Ex, 0.1
gExParts Ex, 1, 1, 1, 1
gAddExContour Ex, ""
gExContAddNode Ex, 0, -1.5, -1.5, 0
gExContAddNode Ex, 0, 1.5, -1.5, 0
gExContAddNode Ex, 0, 1.5, 1.5, 0
gExContAddNode Ex, 0, -1.5, 1.5, 0
gAddExContour Ex, ""
gExContAddNode Ex, 1, -1.4, -1.4, 0
gExContAddNode Ex, 1, 1.4, -1.4, 0
gExContAddNode Ex, 1, 1.4, 1.4, 0
gExContAddNode Ex, 1, -1.4, 1.4, 0 


While gKeyHit(KEY_ESCAPE) = 0 And gProgress() = 1

	newTime# = gGetNewTime() * 40
	deltaTime# = gGetDeltaTime()

    	gRotate Torus, deltaTime * 100, 0, 0
    	gTurn CameraPV, deltaTime * 20

Wend

gCloseGraphics()