BasicGL for Blitz

Blitz3D Forums/Blitz3D Programming/BasicGL for Blitz

Even better - 2 mirrors (although, the reproducing plane geometry is back again):
;###################################################################
;                                                              
;                 		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 

;Create Another Mirror
Mirror2 = gCreateMirror(3, 3, 0)
gSetAbsDir mirror2, 0, 0, -1
gSetAbsPos mirror2, 0, 0, 2.5
;gObjDiffuse mirror, 0, 0, 1, 0.8
gLoadObjectTexture mirror2, "..\..\media\back2.jpg"

;Create Another Extrusion
Ex2 = gCreateExtrusion(mirror2)
gObjDiffuse Ex2, 1, 0.1, 0, 1
gExHeight Ex2, 0.1
gExParts Ex2, 1, 1, 1, 1
gAddExContour Ex2, ""
gExContAddNode Ex2, 0, -1.5, -1.5, 0
gExContAddNode Ex2, 0, 1.5, -1.5, 0
gExContAddNode Ex2, 0, 1.5, 1.5, 0
gExContAddNode Ex2, 0, -1.5, 1.5, 0
gAddExContour Ex2, ""
gExContAddNode Ex2, 1, -1.4, -1.4, 0
gExContAddNode Ex2, 1, 1.4, -1.4, 0
gExContAddNode Ex2, 1, 1.4, 1.4, 0
gExContAddNode Ex2, 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()