home *** CD-ROM | disk | FTP | other *** search
- G.SetGroup( "Cam" )
- local Cam = G.Create( "Data/BasicCamera.xml");
- local pos = Vector3(50,60,50);
- Cam.SetPosition( pos );
-
- MCog = G.Create( "Data/ModelCog.xml" );
- MCog.SetPosition( Vector3(90,10,90) );
- MCog.SetAnimation( "Fire" );
-
- Obj = G.Create( "Data/KnotCog.xml" );
- Obj.SetPosition( Vector3(90, 0 , 90) );
-
- Obj = G.Create( "Data/PlaneCog.xml" );
- Obj.SetPosition( Vector3(90,0,90) );
-
- Obj = G.Create( "Data/LightCog.xml" );
- Obj.SetPosition( Vector3(90, 16 , 90) );
-
- shaderindex = 0;
- shaders = {};
- shaders[0] = "Basic";
- shaders[1] = "VertSpec";
- shaders[2] = "Mem";
- shaders[3] = "Spec";
- shaders[4] = "ViewShine";
-
- bshaderindex = 0;
- bshaders = {};
- bshaders[0] = "Para";
- bshaders[1] = "Bump";
-
- function ShaderChange()
-
- if( G.KeyTriggered( "Q" ) ) then
- local PCog = G.Create( "Data/LargeExplo.xml" );
- --local PCog = G.Create( "Data/SmallFireEffect.xml" );
- PCog.SetPosition( Vector3(80,50,80) );
- end
-
-
- if( G.MouseTriggered( 2 ) ) then
- local pObj = G.ScreenPick();
-
- if( pObj.IsValid() ) then
- TargetPos = pObj.GetPosition();
- G.GenIK( MCog , TargetPos );
- end
-
- end
-
- if( G.MouseTriggered( 0 ) ) then
- MCog = G.ScreenPick();
- end
-
- --if( G.KeyTriggered( "I" ) and TargetPos ) then
- --pObj.Destroy();
- --end
-
- if( G.KeyTriggered( "G" ) ) then
-
- if( shaders[ shaderindex ] ) then
- MCog.SetShader( shaders[ shaderindex ] );
- shaderindex = shaderindex + 1
- else
- shaderindex = 0;
- MCog.SetShader( shaders[ shaderindex ] );
- shaderindex = shaderindex + 1
- end
- end
-
- if( G.KeyTriggered( "H" ) ) then
- MCog.CycleAnimation();
- end
-
- if( G.KeyTriggered( "B" ) ) then
-
- if( bshaders[ bshaderindex ] ) then
- local MCog = G.GetCogName( "PlaneCog" );
- MCog.SetShader( bshaders[ bshaderindex ] );
- bshaderindex = bshaderindex + 1
- else
- bshaderindex = 0;
- local MCog = G.GetCogName( "PlaneCog" );
- MCog.SetShader( bshaders[ bshaderindex ] );
- bshaderindex = bshaderindex + 1
- end
-
- end
- end
-
- function DooDad()
- if( G.KeyTriggered( "F" ) ) then
- local d = G.Create( "Data/LargePineTree.xml" );
- local mpos = G.GetTerrainIntersection();
- d.SetPosition( mpos );
- end
- end
-
- GMain[ "DooDad" ] = DooDad;
- GMain[ "ShaderChange" ] = ShaderChange;
-