private void InitializeModifiers() { sceneModifier = AddBoolean("Scene", "Render scene", true); toneMappingModifier = AddBoolean("ToneMapping", "ToneMapping", true); bloomModifier = AddBoolean("Bloom", "Add bloom", true); passesModifier = AddInt("Cantidad de pasadas de blur", 1, 30, 10); }
public override void Init() { //Modifiers para variar parametros de la pared originModifier = AddVertex3f("origin", new TGCVector3(-100, -100, -100), new TGCVector3(100, 100, 100), TGCVector3.Empty); dimensionModifier = AddVertex3f("dimension", new TGCVector3(-100, -100, -100), new TGCVector3(1000, 1000, 100), new TGCVector3(100, 100, 100)); orientationModifier = AddInterval("orientation", new[] { "XY", "XZ", "YZ" }, 0); tilingModifier = AddVertex2f("tiling", TGCVector2.Zero, new TGCVector2(10, 10), TGCVector2.One); autoAdjustModifier = AddBoolean("autoAdjust", "autoAdjust", false); //Modifier de textura var texturePath = MediaDir + "Texturas\\Quake\\TexturePack2\\brick1_1.jpg"; currentTexture = TgcTexture.createTexture(D3DDevice.Instance.Device, texturePath); textureModifier = AddTexture("texture", currentTexture.FilePath); //Crear pared plane = new TgcPlane(); plane.setTexture(currentTexture); //Actualizar segun valores cargados updateTGCPlane(); //Ajustar camara segun tamano de la pared Camara = new TgcRotationalCamera(plane.BoundingBox.calculateBoxCenter(), plane.BoundingBox.calculateBoxRadius() * 2, Input); }
public override void Init() { //Texto para el sonido actual currentSoundText = new TgcText2D(); currentSoundText.Text = "No sound"; currentSoundText.Position = new Point(50, 20); currentSoundText.Color = Color.Gold; currentSoundText.changeFont(new Font(FontFamily.GenericMonospace, 16, FontStyle.Italic)); //Texto de instrucciones instruccionesText = new TgcText2D(); instruccionesText.Text = "Y = Play, O = Stop."; instruccionesText.Position = new Point(50, 60); instruccionesText.Color = Color.Green; instruccionesText.changeFont(new Font(FontFamily.GenericMonospace, 16, FontStyle.Bold)); //Modifier para archivo MP3 currentFile = null; wavFileModifier = AddFile("WAV-File", MediaDir + "Sound\\campanadas horas.wav", "WAVs|*.wav"); //Modifier para loop playLoopModifier = AddBoolean("PlayLoop", "Play Loop", false); var filePath = wavFileModifier.Value; loadSound(filePath); }
public override void Init() { //Crear esfera sphere = new TGCSphere(); //No recomendamos utilizar AutoTransformEnable, con juegos complejos se pierde el control. sphere.AutoTransform = true; currentTexture = null; //Modifiers para vararis sus parametros baseModifier = AddEnum("base", typeof(TGCSphere.eBasePoly), TGCSphere.eBasePoly.ICOSAHEDRON); inflateModifier = AddBoolean("inflate", "yes", true); levelOfDetailModifier = AddInterval("level of detail", new object[] { 0, 1, 2, 3, 4 }, 2); edgesModifier = AddBoolean("edges", "show", false); radiusModifier = AddFloat("radius", 0, 100, 10); positionModifier = AddVertex3f("position", new TGCVector3(-100, -100, -100), new TGCVector3(100, 100, 100), TGCVector3.Empty); rotationModifier = AddVertex3f("rotation", new TGCVector3(-180, -180, -180), new TGCVector3(180, 180, 180), TGCVector3.Empty); useTextureModifier = AddBoolean("Use texture", "yes", true); textureModifier = AddTexture("texture", MediaDir + "\\Texturas\\madera.jpg"); offsetModifier = AddVertex2f("offset", new TGCVector2(-0.5f, -0.5f), new TGCVector2(0.9f, 0.9f), TGCVector2.Zero); tilingModifier = AddVertex2f("tiling", new TGCVector2(0.1f, 0.1f), new TGCVector2(4, 4), TGCVector2.One); colorModifier = AddColor("color", Color.White); boundingsphereModifier = AddBoolean("boundingsphere", "show", false); UserVars.addVar("Vertices"); UserVars.addVar("Triangulos"); Camara = new TgcRotationalCamera(TGCVector3.Empty, 50f, Input); }
public override void Init() { //Cargar escenario var loader = new TgcSceneLoader(); //Configurar MeshFactory customizado scene = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Scenes\\Deposito\\Deposito-TgcScene.xml"); //Camara en 1ra persona Camera = new TgcFpsCamera(new TGCVector3(200, 250, 175), 400f, 300f, Input); //Mesh para la luz lightMesh = TGCBox.fromSize(new TGCVector3(10, 10, 10), Color.Red); //Modifiers de la luz lightEnableModifier = AddBoolean("lightEnable", "lightEnable", true); lightPosModifier = AddVertex3f("lightPos", new TGCVector3(-200, -100, -200), new TGCVector3(200, 200, 300), new TGCVector3(-60, 90, 175)); lightDirModifier = AddVertex3f("lightDir", new TGCVector3(-1, -1, -1), TGCVector3.One, new TGCVector3(-0.05f, 0, 0)); lightColorModifier = AddColor("lightColor", Color.White); lightIntensityModifier = AddFloat("lightIntensity", 0, 150, 35); lightAttenuationModifier = AddFloat("lightAttenuation", 0.1f, 2, 0.3f); specularExModifier = AddFloat("specularEx", 0, 20, 9f); spotAngleModifier = AddFloat("spotAngle", 0, 180, 39f); spotExponentModifier = AddFloat("spotExponent", 0, 20, 7f); //Modifiers de material mEmissiveModifier = AddColor("mEmissive", Color.Black); mAmbientModifier = AddColor("mAmbient", Color.White); mDiffuseModifier = AddColor("mDiffuse", Color.White); mSpecularModifier = AddColor("mSpecular", Color.White); }
public override void Init() { //Crear SkyBox skyBox = new TgcSkyBox(); skyBox.Center = new TGCVector3(0, 500, 0); skyBox.Size = new TGCVector3(10000, 10000, 10000); var texturesPath = MediaDir + "Texturas\\Quake\\SkyBox LostAtSeaDay\\"; skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Up, texturesPath + "lostatseaday_up.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Down, texturesPath + "lostatseaday_dn.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Left, texturesPath + "lostatseaday_lf.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Right, texturesPath + "lostatseaday_rt.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Front, texturesPath + "lostatseaday_bk.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Back, texturesPath + "lostatseaday_ft.jpg"); skyBox.Init(); //Cargar escenario de Isla var loader = new TgcSceneLoader(); var scene = loader.loadSceneFromFile(MediaDir + "Isla\\Isla-TgcScene.xml"); //Separar el Terreno del resto de los objetos var list1 = new List<TgcMesh>(); scene.separeteMeshList(new[] { "Terreno" }, out list1, out objetosIsla); terreno = list1[0]; //Crear grilla grilla = new GrillaRegular(); grilla.create(objetosIsla, scene.BoundingBox); grilla.createDebugMeshes(); //Camara en 1ra persona Camara = new TgcFpsCamera(new TGCVector3(1500, 800, 0), Input); showGridModifier = AddBoolean("showGrid", "Show Grid", false); showTerrainModifier = AddBoolean("showTerrain", "Show Terrain", true); }
public override void Init() { //Malla default var initialMeshFile = MediaDir + "MeshCreator\\Meshes\\Vehiculos\\CamionDeAgua\\CamionDeAgua-TgcScene.xml"; //Modifiers currentScene = null; currentPath = null; meshModifier = AddFile("Mesh", initialMeshFile, "-TgcScene.xml |*-TgcScene.xml"); reloadModifier = AddButton("Reload", "Reload", Reload_ButtonClick); currentColor = Color.White; colorModifier = AddColor("Color", currentColor); boundingBoxModifier = AddBoolean("BoundingBox", "BoundingBox", false); currentAlphaBlending = false; alphaBlendingModifier = AddBoolean("AlphaBlending", "AlphaBlending", currentAlphaBlending); //UserVars UserVars.addVar("Name"); UserVars.addVar("Meshes"); UserVars.addVar("Textures"); UserVars.addVar("Triangles"); UserVars.addVar("Vertices"); UserVars.addVar("SizeX"); UserVars.addVar("SizeY"); UserVars.addVar("SizeZ"); }
/// <summary> /// Modificador para valores Boolean. /// </summary> /// <param name="varName">Nombre del modificador.</param> /// <param name="text">Descripcion.</param> /// <param name="defaultValue">Valor default.</param> /// <returns>Modificador que se agrego.</returns> public TGCBooleanModifier AddBoolean(string varName, string text, bool defaultValue) { var booleanModifier = new TGCBooleanModifier(varName, text, defaultValue); AddModifier(booleanModifier); return(booleanModifier); }
public override void Init() { //Crear SkyBox skyBox = new TgcSkyBox(); skyBox.Center = TGCVector3.Empty; skyBox.Size = new TGCVector3(10000, 10000, 10000); //Configurar color //skyBox.Color = Color.OrangeRed; var texturesPath = MediaDir + "Texturas\\Quake\\SkyBox1\\"; //Configurar las texturas para cada una de las 6 caras skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Up, texturesPath + "phobos_up.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Down, texturesPath + "phobos_dn.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Left, texturesPath + "phobos_lf.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Right, texturesPath + "phobos_rt.jpg"); //Hay veces es necesario invertir las texturas Front y Back si se pasa de un sistema RightHanded a uno LeftHanded skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Front, texturesPath + "phobos_bk.jpg"); skyBox.setFaceTexture(TgcSkyBox.SkyFaces.Back, texturesPath + "phobos_ft.jpg"); skyBox.SkyEpsilon = 25f; //Inicializa todos los valores para crear el SkyBox skyBox.Init(); //Modifier para mover el skybox con la posicion de la caja con traslaciones. moveWithCameraModifier = AddBoolean("moveWithCamera", "Move With Camera", false); Camara = new TgcFpsCamera(Input); }
public override void Init() { time = 0; var d3dDevice = D3DDevice.Instance.Device; MyShaderDir = ShadersDir + "WorkshopShaders\\"; //Cargamos un escenario var loader = new TgcSceneLoader(); var scene = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Scenes\\Deposito\\Deposito-TgcScene.xml"); meshes = scene.Meshes; //Cargar Shader personalizado string compilationErrors; effect = Effect.FromFile(d3dDevice, MyShaderDir + "FullQuad.fx", null, null, ShaderFlags.PreferFlowControl, null, out compilationErrors); if (effect == null) { throw new Exception("Error al cargar shader. Errores: " + compilationErrors); } //Configurar Technique dentro del shader effect.Technique = "DefaultTechnique"; //Camara en primera persona Camara = new TgcFpsCamera(new TGCVector3(250, 160, -570), Input); g_pDepthStencil = d3dDevice.CreateDepthStencilSurface(d3dDevice.PresentationParameters.BackBufferWidth, d3dDevice.PresentationParameters.BackBufferHeight, DepthFormat.D24S8, MultiSampleType.None, 0, true); // inicializo el render target g_pRenderTarget = new Texture(d3dDevice, d3dDevice.PresentationParameters.BackBufferWidth , d3dDevice.PresentationParameters.BackBufferHeight, 1, Usage.RenderTarget, Format.X8R8G8B8, Pool.Default); effect.SetValue("g_RenderTarget", g_pRenderTarget); // Resolucion de pantalla effect.SetValue("screen_dx", d3dDevice.PresentationParameters.BackBufferWidth); effect.SetValue("screen_dy", d3dDevice.PresentationParameters.BackBufferHeight); CustomVertex.PositionTextured[] vertices = { new CustomVertex.PositionTextured(-1, 1, 1, 0, 0), new CustomVertex.PositionTextured(1, 1, 1, 1, 0), new CustomVertex.PositionTextured(-1, -1, 1, 0, 1), new CustomVertex.PositionTextured(1, -1, 1, 1, 1) }; //vertex buffer de los triangulos g_pVBV3D = new VertexBuffer(typeof(CustomVertex.PositionTextured), 4, d3dDevice, Usage.Dynamic | Usage.WriteOnly, CustomVertex.PositionTextured.Format, Pool.Default); g_pVBV3D.SetData(vertices, 0, LockFlags.None); activarEfectoModifier = AddBoolean("activar_efecto", "Activar efecto", true); }
public override void Init() { //Se crean 2 triangulos (o Quad) con las dimensiones de la pantalla con sus posiciones ya transformadas // x = -1 es el extremo izquiedo de la pantalla, x = 1 es el extremo derecho // Lo mismo para la Y con arriba y abajo // la Z en 1 simpre CustomVertex.PositionTextured[] screenQuadVertices = { new CustomVertex.PositionTextured(-1, 1, 1, 0, 0), new CustomVertex.PositionTextured(1, 1, 1, 1, 0), new CustomVertex.PositionTextured(-1, -1, 1, 0, 1), new CustomVertex.PositionTextured(1, -1, 1, 1, 1) }; //vertex buffer de los triangulos screenQuadVB = new VertexBuffer(typeof(CustomVertex.PositionTextured), 4, D3DDevice.Instance.Device, Usage.Dynamic | Usage.WriteOnly, CustomVertex.PositionTextured.Format, Pool.Default); screenQuadVB.SetData(screenQuadVertices, 0, LockFlags.None); //Creamos un Render Targer sobre el cual se va a dibujar la pantalla renderTarget2D = new Texture(D3DDevice.Instance.Device, D3DDevice.Instance.Device.PresentationParameters.BackBufferWidth, D3DDevice.Instance.Device.PresentationParameters.BackBufferHeight, 1, Usage.RenderTarget, Format.X8R8G8B8, Pool.Default); //Creamos un DepthStencil que debe ser compatible con nuestra definicion de renderTarget2D. depthStencil = D3DDevice.Instance.Device.CreateDepthStencilSurface(D3DDevice.Instance.Device.PresentationParameters.BackBufferWidth, D3DDevice.Instance.Device.PresentationParameters.BackBufferHeight, DepthFormat.D24S8, MultiSampleType.None, 0, true); depthStencilOld = D3DDevice.Instance.Device.DepthStencilSurface; //Cargar shader con efectos de Post-Procesado effect = TGCShaders.Instance.LoadEffect(ShadersDir + "PostProcess.fx"); //Configurar Technique dentro del shader effect.Technique = "AlarmaTechnique"; //Cargar textura que se va a dibujar arriba de la escena del Render Target alarmTexture = TgcTexture.createTexture(D3DDevice.Instance.Device, MediaDir + "Texturas\\efecto_alarma.png"); //Interpolador para efecto de variar la intensidad de la textura de alarma intVaivenAlarm = new InterpoladorVaiven(); intVaivenAlarm.Min = 0; intVaivenAlarm.Max = 1; intVaivenAlarm.Speed = 5; intVaivenAlarm.reset(); //Cargamos un escenario var loader = new TgcSceneLoader(); var scene = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Scenes\\Deposito\\Deposito-TgcScene.xml"); meshes = scene.Meshes; //Camara en primera persona Camera = new TgcFpsCamera(new TGCVector3(250, 160, -570), Input); //Modifier para activar/desactivar efecto de alarma activarEfectoModifier = AddBoolean("activar_efecto", "Activar efecto", true); //Modifier para activar/desactivar stensil para ver como el ejemplo se rompe. activarStencilModifier = AddBoolean("activar_stencil", "Activar stensil", true); }
public override void Init() { //Triangulo 1. //Definir array de vertices para el triangulo, del tipo Coordendas (X,Y,Z) + Color simpleTriangleData = new CustomVertex.PositionColored[3]; //Cargar informacion de vertices. Nesitamos 3 vertices para crear un triangulo simpleTriangleData[0] = new CustomVertex.PositionColored(-1, 0, 0, Color.Red.ToArgb()); simpleTriangleData[1] = new CustomVertex.PositionColored(1, 0, 0, Color.Green.ToArgb()); simpleTriangleData[2] = new CustomVertex.PositionColored(0, 1, 0, Color.Blue.ToArgb()); //Cargar variables de usuario con alguna informacion util para ver en pantalla UserVars.addVar("Triangle 1 vertices", simpleTriangleData.Length); //Triangulo 2. //Current texture currentTexurePah = MediaDir + "Texturas\\baldosaFacultad.jpg"; texture = TextureLoader.FromFile(D3DDevice.Instance.Device, currentTexurePah); //Modifiers vertex1Modifier = AddVertex3f("vertex1", new TGCVector3(-3, -3, -3), new TGCVector3(3, 3, 3), new TGCVector3(-1, 0, 0)); texCoord1Modifier = AddVertex2f("texCoord1", TGCVector2.Zero, TGCVector2.One, new TGCVector2(1, 0)); color1Modifier = AddColor("color1", Color.White); vertex2Modifier = AddVertex3f("vertex2", new TGCVector3(-3, -3, -3), new TGCVector3(3, 3, 3), new TGCVector3(1, 0, 0)); texCoord2Modifier = AddVertex2f("texCoord2", TGCVector2.Zero, TGCVector2.One, new TGCVector2(0, 1)); color2Modifier = AddColor("color2", Color.White); vertex3Modifier = AddVertex3f("vertex3", new TGCVector3(-3, -3, -3), new TGCVector3(3, 3, 3), TGCVector3.Up); texCoord3Modifier = AddVertex2f("texCoord3", TGCVector2.Zero, TGCVector2.One, TGCVector2.One); color3Modifier = AddColor("color3", Color.White); rotationModifier = AddFloat("rotation", -2, 2f, 0f); textureEnableModifier = AddBoolean("TextureEnable", "Con textura", true); textureImageModifier = AddTexture("Texture image", currentTexurePah); //Triangulo 3. //Crear vertexBuffer vertexBuffer = new VertexBuffer(typeof(CustomVertex.PositionColored), 3, D3DDevice.Instance.Device, Usage.Dynamic | Usage.WriteOnly, CustomVertex.PositionColored.Format, Pool.Default); //Cargar informacion de vertices: (X,Y,Z) + Color var data = new CustomVertex.PositionColored[3]; data[0] = new CustomVertex.PositionColored(-1, 0, 0, Color.Red.ToArgb()); data[1] = new CustomVertex.PositionColored(1, 0, 0, Color.Green.ToArgb()); data[2] = new CustomVertex.PositionColored(0, 1, 0, Color.Blue.ToArgb()); //Almacenar informacion en VertexBuffer vertexBuffer.SetData(data, 0, LockFlags.None); //User Vars UserVars.addVar("Triangle 3 vertices"); UserVars.setValue("Triangle 3 vertices", data.Length); //Configurar camara en rotacion Camara = new TgcRotationalCamera(new TGCVector3(0, 0.5f, 0), 7.5f, Input); }
public override void Init() { //Paths para archivo XML de la malla var pathMesh = MediaDir + "KeyframeAnimations\\Robot\\Robot-TgcKeyFrameMesh.xml"; //Path para carpeta de texturas de la malla var mediaPath = MediaDir + "KeyframeAnimations\\Robot\\"; //Lista de animaciones disponibles string[] animationList = { "Parado", "Caminando", "Correr", "PasoDerecho", "PasoIzquierdo", "Empujar", "Patear", "Pegar", "Arrojar" }; //Crear rutas con cada animacion var animationsPath = new string[animationList.Length]; for (var i = 0; i < animationList.Length; i++) { animationsPath[i] = mediaPath + animationList[i] + "-TgcKeyFrameAnim.xml"; } //Cargar mesh y animaciones var loader = new TgcKeyFrameLoader(); mesh = loader.loadMeshAndAnimationsFromFile(pathMesh, mediaPath, animationsPath); //Agregar combo para elegir animacion selectedAnim = animationList[0]; animationModifier = AddInterval("animation", animationList, 0); //Modifier para especificar si la animacion se anima con loop animateWithLoop = true; loopModifier = AddBoolean("loop", "Loop anim:", animateWithLoop); //Modifier para color currentColor = Color.White; colorModifier = AddColor("Color", currentColor); //Modifier para BoundingBox boundingBoxModifier = AddBoolean("BoundingBox", "BoundingBox:", false); //Elegir animacion Caminando mesh.playAnimation(selectedAnim, true); //Configurar camara Camera = new TgcRotationalCamera(new TGCVector3(0, 70, 0), 200, Input); }
public override void Init() { time = 0; Device d3dDevice = D3DDevice.Instance.Device; //Cargamos un escenario TgcSceneLoader loader = new TgcSceneLoader(); TgcScene scene = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Scenes\\Deposito\\Deposito-TgcScene.xml"); meshes = scene.Meshes; //Cargar Shader personalizado string compilationErrors; effect = Effect.FromFile(d3dDevice, ShadersDir + "WorkshopShaders\\FullQuad.fx", null, null, ShaderFlags.PreferFlowControl, null, out compilationErrors); if (effect == null) { throw new Exception("Error al cargar shader. Errores: " + compilationErrors); } //Configurar Technique dentro del shader effect.Technique = "DefaultTechnique"; //Camara en primera personas Camara = new TgcFpsCamera(new TGCVector3(-182.3816f, 82.3252f, -811.9061f), 100, 10, Input); g_pDepthStencil = d3dDevice.CreateDepthStencilSurface(d3dDevice.PresentationParameters.BackBufferWidth, d3dDevice.PresentationParameters.BackBufferHeight, DepthFormat.D24S8, MultiSampleType.None, 0, true); // inicializo el render target g_pRenderTarget = new Texture(d3dDevice, d3dDevice.PresentationParameters.BackBufferWidth, d3dDevice.PresentationParameters.BackBufferHeight, 1, Usage.RenderTarget, Format.X8R8G8B8, Pool.Default); effect.SetValue("g_RenderTarget", g_pRenderTarget); // Resolucion de pantalla effect.SetValue("screen_dx", d3dDevice.PresentationParameters.BackBufferWidth); effect.SetValue("screen_dy", d3dDevice.PresentationParameters.BackBufferHeight); CustomVertex.PositionTextured[] vertices = new CustomVertex.PositionTextured[] { new CustomVertex.PositionTextured(-1, 1, 1, 0, 0), new CustomVertex.PositionTextured(1, 1, 1, 1, 0), new CustomVertex.PositionTextured(-1, -1, 1, 0, 1), new CustomVertex.PositionTextured(1, -1, 1, 1, 1) }; //vertex buffer de los triangulos g_pVBV3D = new VertexBuffer(typeof(CustomVertex.PositionTextured), 4, d3dDevice, Usage.Dynamic | Usage.WriteOnly, CustomVertex.PositionTextured.Format, Pool.Default); g_pVBV3D.SetData(vertices, 0, LockFlags.None); distorcionadorModifier = AddEnum("distorcionador", typeof(Distorciones), Distorciones.Pincushion); gridModifier = AddBoolean("grid", "mostrar grilla", false); kuModifier = AddFloat("Ku", 0, 1, 0.1f); kvModifier = AddFloat("Kv", 0, 1, 0.1f); ocScaleInModifier = AddFloat("oc_scale_in", 0.1f, 4, 2.5f); ocScaleModifier = AddFloat("oc_scale", 0.01f, 1f, 0.35f); }
public override void Init() { //Cargar escenario, pero inicialmente solo hacemos el parser, para separar los objetos que son solo luces y no meshes var scenePath = MediaDir + "Escenario\\EscenarioLuces-TgcScene.xml"; var mediaPath = MediaDir + "Escenario\\"; var parser = new TgcSceneParser(); var sceneData = parser.parseSceneFromString(File.ReadAllText(scenePath)); //Separar modelos reales de las luces, segun layer "Lights" lights = new List <LightData>(); var realMeshData = new List <TgcMeshData>(); for (var i = 0; i < sceneData.meshesData.Length; i++) { var meshData = sceneData.meshesData[i]; //Es una luz, no cargar mesh, solo importan sus datos if (meshData.layerName == "Lights") { //Guardar datos de luz var light = new LightData(); light.color = Color.FromArgb((int)meshData.color[0], (int)meshData.color[1], (int)meshData.color[2]); light.aabb = new TgcBoundingAxisAlignBox(TGCVector3.Float3ArrayToVector3(meshData.pMin), TGCVector3.Float3ArrayToVector3(meshData.pMax)); light.pos = light.aabb.calculateBoxCenter(); lights.Add(light); } //Es un mesh real, agregar a array definitivo else { realMeshData.Add(meshData); } } //Reemplazar array original de meshData de sceneData por el definitivo sceneData.meshesData = realMeshData.ToArray(); //Ahora si cargar meshes reales var loader = new TgcSceneLoader(); scene = loader.loadScene(sceneData, mediaPath); //Camara en 1ra persona Camara = new TgcFpsCamera(new TGCVector3(-20, 80, 450), 400f, 300f, Input); //Modifiers para variables de luz lightEnableModifier = AddBoolean("lightEnable", "lightEnable", true); lightIntensityModifier = AddFloat("lightIntensity", 0, 150, 20); lightAttenuationModifier = AddFloat("lightAttenuation", 0.1f, 2, 0.3f); specularExModifier = AddFloat("specularEx", 0, 20, 9f); //Modifiers para material mEmissiveModifier = AddColor("mEmissive", Color.Black); mAmbientModifier = AddColor("mAmbient", Color.White); mDiffuseModifier = AddColor("mDiffuse", Color.White); mSpecularModifier = AddColor("mSpecular", Color.White); }
public override void Init() { createMeshes(); //Crear Material material = new Material(); //Crear una fuente de luz direccional en la posicion 0. D3DDevice.Instance.Device.Lights[0].Type = LightType.Directional; D3DDevice.Instance.Device.Lights[0].Diffuse = Color.White; D3DDevice.Instance.Device.Lights[0].Ambient = Color.White; D3DDevice.Instance.Device.Lights[0].Specular = Color.White; D3DDevice.Instance.Device.Lights[0].Range = 1000; D3DDevice.Instance.Device.Lights[0].Enabled = true; //Habilitar esquema de Iluminacion Dinamica D3DDevice.Instance.Device.RenderState.Lighting = true; //Configurar camara rotacional Camera = new TgcRotationalCamera(TGCVector3.Empty, 15f, Input); //El tipo de mesh para seleccionar. selectedMeshModifier = AddInterval("SelectedMesh", new[] { "Teapot", "Face" }, 0); //Selecciona el modo de shading. shaderModeModifier = AddInterval("ShaderMode", new[] { "Gouraud", "Flat" }, 1); //Habilito o deshabilito mostrar las normales normalesModifier = AddBoolean("Normales", "Mostrar normales", false); //El exponente del nivel de brillo de la iluminacion especular. specularSharpnessModifier = AddFloat("SpecularSharpness", 0, 500f, 100.00f); //Habilita o deshabilita el brillo especular. specularEnabledModifier = AddBoolean("SpecularEnabled", "Enable Specular", true); //Los distintos colores e intensidades de cada uno de los tipos de iluminacion. ambientModifier = AddColor("Ambient", Color.LightSlateGray); diffuseModifier = AddColor("Diffuse", Color.Gray); specularModifier = AddColor("Specular", Color.LightSteelBlue); //Habilita o deshabilita el remarcado de los bordes de cada triangulo. wireframeModifier = AddBoolean("Wireframe", "Enable Wireframe", false); //Habilita o deshabilita el back face culling backFaceCullModifier = AddBoolean("BackFaceCull", "Enable BackFaceCulling", false); //Modifiers para angulos de rotacion de la luz angleXModifier = AddFloat("angleX", 0, 0.005f, 0.0f); angleYModifier = AddFloat("angleY", 0, 0.005f, 0.0f); angleZModifier = AddFloat("angleZ", 0, 0.005f, 0.0f); //Pongo el fondo negro BackgroundColor = Color.Black; }
public override void Init() { //Objetos en movimiento. colliderCylinder = new TgcBoundingCylinder(TGCVector3.Empty, 2, 4); colliderCylinder.setRenderColor(Color.LimeGreen); colliderCylinderFixedY = new TgcBoundingCylinderFixedY(TGCVector3.Empty, 2, 4); colliderCylinderFixedY.setRenderColor(Color.LimeGreen); //Cargar personaje con animaciones var skeletalLoader = new TgcSkeletalLoader(); personaje = skeletalLoader.loadMeshAndAnimationsFromFile( MediaDir + "SkeletalAnimations\\Robot\\Robot-TgcSkeletalMesh.xml", MediaDir + "SkeletalAnimations\\Robot\\", new[] { MediaDir + "SkeletalAnimations\\Robot\\Caminando-TgcSkeletalAnim.xml", MediaDir + "SkeletalAnimations\\Robot\\Parado-TgcSkeletalAnim.xml" }); //Configurar animacion inicial personaje.playAnimation("Parado", true); //Escalarlo porque es muy grande personaje.Scale = new TGCVector3(0.04f, 0.04f, 0.04f); //El personaje esta en el 0,0,0 hay que bajarlo var size = personaje.BoundingBox.PMax.Y - personaje.BoundingBox.PMin.Y; personaje.Position = new TGCVector3(0, -3f, 0); //Rotarlo 180° porque esta mirando para el otro lado personaje.Rotation = new TGCVector3(0, FastMath.PI, 0); personaje.Transform = TGCMatrix.RotationY(personaje.Rotation.Y) * TGCMatrix.Translation(personaje.Position); //Objetos estaticos, pueden ser mesh o objetos simplificados. var loader = new TgcSceneLoader(); var scene = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Meshes\\Vehiculos\\Patrullero\\Patrullero-TgcScene.xml"); collisionableMeshAABB = scene.Meshes[0]; collisionableMeshAABB.Scale = new TGCVector3(0.1f, 0.1f, 0.1f); collisionableMeshAABB.Position = new TGCVector3(6, 0, -2); collisionableCylinder = new TgcBoundingCylinderFixedY(new TGCVector3(-6, 0, 0), 2, 2); collisionableSphere = new TgcBoundingSphere(new TGCVector3(-3, 0, 10), 3); fixedYModifier = AddBoolean("fixedY", "use fixed Y", true); //Modifier para ver BoundingBox del personaje showBoundingBoxModifier = AddBoolean("showBoundingBox", "Personaje Bouding Box", false); sizeModifier = AddVertex2f("size", TGCVector2.One, new TGCVector2(5, 10), new TGCVector2(2, 5)); var angle = FastMath.TWO_PI; rotationModifier = AddVertex3f("rotation", new TGCVector3(-angle, -angle, -angle), new TGCVector3(angle, angle, angle), new TGCVector3(FastMath.TWO_PI / 8, 0, FastMath.TWO_PI / 8)); //Configurar camara en Tercer Persona camaraInterna = new TgcThirdPersonCamera(personaje.Position, 25, -45); Camera = camaraInterna; }
public override void Init() { Device d3dDevice = D3DDevice.Instance.Device; //Cargamos un escenario TgcSceneLoader loader = new TgcSceneLoader(); TgcScene scene = loader.loadSceneFromFile(MediaDir + "\\MeshCreator\\Meshes\\Esqueletos\\EsqueletoHumano3\\Esqueleto3-TgcScene.xml"); mesh = scene.Meshes[0]; //Cargar Shader personalizado string compilationErrors; effect = Effect.FromFile(d3dDevice, ShadersDir + "WorkshopShaders\\GaussianBlur.fx", null, null, ShaderFlags.PreferFlowControl, null, out compilationErrors); if (effect == null) { throw new Exception("Error al cargar shader. Errores: " + compilationErrors); } //Configurar Technique dentro del shader effect.Technique = "DefaultTechnique"; //Camara en primera persona Camara = new TgcFpsCamera(new TGCVector3(50, 30, 50), 100, 10, Input); g_pDepthStencil = d3dDevice.CreateDepthStencilSurface(d3dDevice.PresentationParameters.BackBufferWidth, d3dDevice.PresentationParameters.BackBufferHeight, DepthFormat.D24S8, MultiSampleType.None, 0, true); // inicializo el render target g_pRenderTarget = new Texture(d3dDevice, d3dDevice.PresentationParameters.BackBufferWidth, d3dDevice.PresentationParameters.BackBufferHeight, 1, Usage.RenderTarget, Format.X8R8G8B8, Pool.Default); effect.SetValue("g_RenderTarget", g_pRenderTarget); // Blur Factor g_pBlurFactor = new Texture(d3dDevice, d3dDevice.PresentationParameters.BackBufferWidth, d3dDevice.PresentationParameters.BackBufferHeight, 1, Usage.RenderTarget, Format.X8R8G8B8, Pool.Default); effect.SetValue("g_BlurFactor", g_pBlurFactor); // Resolucion de pantalla effect.SetValue("screen_dx", d3dDevice.PresentationParameters.BackBufferWidth); effect.SetValue("screen_dy", d3dDevice.PresentationParameters.BackBufferHeight); CustomVertex.PositionTextured[] vertices = new CustomVertex.PositionTextured[] { new CustomVertex.PositionTextured(-1, 1, 1, 0, 0), new CustomVertex.PositionTextured(1, 1, 1, 1, 0), new CustomVertex.PositionTextured(-1, -1, 1, 0, 1), new CustomVertex.PositionTextured(1, -1, 1, 1, 1) }; //vertex buffer de los triangulos g_pVBV3D = new VertexBuffer(typeof(CustomVertex.PositionTextured), 4, d3dDevice, Usage.Dynamic | Usage.WriteOnly, CustomVertex.PositionTextured.Format, Pool.Default); g_pVBV3D.SetData(vertices, 0, LockFlags.None); activarEfectoModifier = AddBoolean("activar_efecto", "Activar efecto", true); focusPlaneModifier = AddFloat("focus_plane", 1, 300, 10); blurFactorModifier = AddFloat("blur_factor", 0.1f, 5f, 0.5f); }
public override void Init() { //Cargar escenario var loader = new TgcSceneLoader(); scene = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Scenes\\Deposito\\Deposito-TgcScene.xml"); //Camara en 1ra persona Camara = new TgcFpsCamera(new TGCVector3(260f, 170f, 390f), 400f, 300f, Input); //Cargar Shader personalizado de MultiDiffuseLights /* * Cargar Shader personalizado de MultiDiffuseLights * Este Shader solo soporta TgcMesh con RenderType DIFFUSE_MAP (que son las unicas utilizadas en este ejemplo) * El shader toma 4 luces a la vez para iluminar un mesh. * Pero como hacer 4 veces los calculos en el shader es costoso, de cada luz solo calcula el componente Diffuse. */ effect = TgcShaders.loadEffect(ShadersDir + "MultiDiffuseLights.fx"); //Crear 4 mesh para representar las 4 para la luces. Las ubicamos en distintas posiciones del escenario, cada una con un color distinto. lightMeshes = new TGCBox[4]; origLightPos = new TGCVector3[lightMeshes.Length]; var c = new Color[4] { Color.Red, Color.Blue, Color.Green, Color.Yellow }; for (var i = 0; i < lightMeshes.Length; i++) { var co = c[i % c.Length]; lightMeshes[i] = TGCBox.fromSize(new TGCVector3(10, 10, 10), co); lightMeshes[i].AutoTransform = true; origLightPos[i] = new TGCVector3(-40, 20 + i * 20, 400); } //Modifiers lightEnableModifier = AddBoolean("lightEnable", "lightEnable", true); lightMoveModifier = AddBoolean("lightMove", "lightMove", true); lightIntensityModifier = AddFloat("lightIntensity", 0, 150, 38); lightAttenuationModifier = AddFloat("lightAttenuation", 0.1f, 2, 0.15f); mEmissiveModifier = AddColor("mEmissive", Color.Black); mDiffuseModifier = AddColor("mDiffuse", Color.White); //Interpolador para mover las luces de un lado para el otro interp = new InterpoladorVaiven(); interp.Min = -200f; interp.Max = 200f; interp.Speed = 100f; interp.Current = 0f; }
private void ConfigureModifiers() { lightPositionModifier = AddVertex3f("LightPosition", new TGCVector3(-500f, 0f, -500f), new TGCVector3(500f, 500f, 500f), new TGCVector3(100f, 80f, 0f)); ambientModifier = AddFloat("Ambient", 0, 1, 0.5f); diffuseModifier = AddFloat("Diffuse", 0, 1, 0.75f); specularModifier = AddFloat("Specular", 0, 1, 0.5f); specularPowerModifier = AddFloat("Shininess", 0f, 50.0f, 15f); ambientColorModifier = AddColor("ambient", Color.Gray); diffuseColorModifier = AddColor("diffuse", Color.LightGoldenrodYellow); specularColorModifier = AddColor("specular", Color.White); toggleBlinn = AddBoolean("Blinn Phong", "Usar Blinn Phong", true); previousValue = toggleBlinn.Value; }
public override void Init() { //Cargar escenario var loader = new TgcSceneLoader(); scene = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Scenes\\Deposito\\Deposito-TgcScene.xml"); //Cargar mesh con animaciones var skeletalLoader = new TgcSkeletalLoader(); skeletalMesh = skeletalLoader.loadMeshAndAnimationsFromFile(MediaDir + "SkeletalAnimations\\Robot\\Robot-TgcSkeletalMesh.xml", new[] { MediaDir + "SkeletalAnimations\\Robot\\Parado-TgcSkeletalAnim.xml" }); //Configurar animacion inicial skeletalMesh.playAnimation("Parado", true); //Corregir normales skeletalMesh.computeNormals(); //Pongo al mesh en posicion skeletalMesh.Position = new TGCVector3(0, 0, 100); skeletalMesh.Transform = TGCMatrix.RotationYawPitchRoll(skeletalMesh.Rotation.Y + FastMath.PI, skeletalMesh.Rotation.X, skeletalMesh.Rotation.Z) * TGCMatrix.Translation(skeletalMesh.Position); skeletalMesh.RotateY(FastMath.PI); //Camara en 1ra persona Camara = new TgcFpsCamera(new TGCVector3(250, 140, 150), Input); //Mesh para la luz lightMesh = TGCBox.fromSize(new TGCVector3(10, 10, 10)); //Pongo al mesh en posicion lightMesh.Position = new TGCVector3(0, 150, 150); lightMesh.Transform = TGCMatrix.Translation(lightMesh.Position); //Modifiers de la luz lightEnableModifier = AddBoolean("lightEnable", "lightEnable", lightMesh.Enabled); lightPosModifier = AddVertex3f("lightPos", new TGCVector3(-200, -100, -200), new TGCVector3(200, 200, 300), lightMesh.Position); lightColorModifier = AddColor("lightColor", lightMesh.Color); lightIntensityModifier = AddFloat("lightIntensity", 0, 150, 20); lightAttenuationModifier = AddFloat("lightAttenuation", 0.1f, 2, 0.3f); specularExModifier = AddFloat("specularEx", 0, 20, 9f); //Modifiers de material mEmissiveModifier = AddColor("mEmissive", Color.Black); mAmbientModifier = AddColor("mAmbient", Color.White); mDiffuseModifier = AddColor("mDiffuse", Color.White); mSpecularModifier = AddColor("mSpecular", Color.White); }
public override void Init() { /* Cargar ecena que tiene un modelo configurado con AlphaBlending * Los modelos fueron exportados en 3Ds MAX con el mapa "Opacity" cargado en el "Material Editor" * Entonces el TgcSceneLoader automaticamente hace mesh.AlphaBlendEnable(true); */ var loader = new TgcSceneLoader(); scene = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Meshes\\Vegetacion\\Pino\\Pino-TgcScene.xml"); //Modifier para activar o desactivar el alpha alphaModifier = AddBoolean("alpha", "Alpha blend", true); Camera = new TgcRotationalCamera(scene.BoundingBox.calculateBoxCenter(), scene.BoundingBox.calculateBoxRadius() * 2, Input); }
public override void Init() { //Se crean 2 triangulos (o Quad) con las dimensiones de la pantalla con sus posiciones ya transformadas // x = -1 es el extremo izquiedo de la pantalla, x = 1 es el extremo derecho // Lo mismo para la Y con arriba y abajo // la Z en 1 simpre CustomVertex.PositionTextured[] screenQuadVertices = { new CustomVertex.PositionTextured(-1, 1, 1, 0, 0), new CustomVertex.PositionTextured(1, 1, 1, 1, 0), new CustomVertex.PositionTextured(-1, -1, 1, 0, 1), new CustomVertex.PositionTextured(1, -1, 1, 1, 1) }; //vertex buffer de los triangulos screenQuadVB = new VertexBuffer(typeof(CustomVertex.PositionTextured), 4, D3DDevice.Instance.Device, Usage.Dynamic | Usage.WriteOnly, CustomVertex.PositionTextured.Format, Pool.Default); screenQuadVB.SetData(screenQuadVertices, 0, LockFlags.None); //Creamos un Render Targer sobre el cual se va a dibujar la pantalla renderTarget2D = new Texture(D3DDevice.Instance.Device, D3DDevice.Instance.Device.PresentationParameters.BackBufferWidth, D3DDevice.Instance.Device.PresentationParameters.BackBufferHeight, 1, Usage.RenderTarget, Format.X8R8G8B8, Pool.Default); //Creamos un DepthStencil que debe ser compatible con nuestra definicion de renderTarget2D. depthStencil = D3DDevice.Instance.Device.CreateDepthStencilSurface(D3DDevice.Instance.Device.PresentationParameters.BackBufferWidth, D3DDevice.Instance.Device.PresentationParameters.BackBufferHeight, DepthFormat.D24S8, MultiSampleType.None, 0, true); //Cargar shader con efectos de Post-Procesado effect = TgcShaders.loadEffect(ShadersDir + "PostProcess.fx"); //Configurar Technique dentro del shader effect.Technique = "OndasTechnique"; //Cargamos un escenario var loader = new TgcSceneLoader(); var scene = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Scenes\\Deposito\\Deposito-TgcScene.xml"); meshes = scene.Meshes; //Camara en primera personas Camara = new TgcFpsCamera(new TGCVector3(250, 160, -570), Input); //Modifier para variar tamano de ondas activarEfectoModifier = AddBoolean("activar_efecto", "Activar efecto", true); waveLengthModifier = AddFloat("wave_length", 0, 300, 200); waveSizeModifier = AddFloat("wave_size", 0.01f, 1, 0.01f); }
public override void Init() { //Path de este ejemplo exampleDir = this.MediaDir + "Quake3Levels\\"; //Cargar nivel inicial currentLevelFile = exampleDir + "q3dm1\\maps\\q3dm1.bsp"; loadLevel(currentLevelFile); //Modifiers openFileModifier = AddFile("Level", currentLevelFile, ".Niveles Quake 3|*.bsp"); speedModifier = AddFloat("Speed", 0, 500f, 350f); gravityModifier = AddFloat("Gravity", 0, 600, 180); jumpSpeedModifier = AddFloat("JumpSpeed", 60, 600, 100); noClipModifier = AddBoolean("NoClip", "NoClip", false); exportButtonModifier = AddButton("exportButton", "Exportar XML", Export_ButtonClick); }
public override void Init() { //Crear Quad vacio quad = new TGCQuad(); //Modifiers para vararia sus parametros sizeModifier = AddVertex2f("size", TGCVector2.Zero, new TGCVector2(100, 100), new TGCVector2(20, 20)); normalModifier = AddVertex3f("normal", new TGCVector3(-10, -10, -10), new TGCVector3(10, 10, 10), new TGCVector3(0, 1, 0)); centerModifier = AddVertex3f("center", new TGCVector3(-10, -10, -10), new TGCVector3(10, 10, 10), TGCVector3.Empty); colorModifier = AddColor("color", Color.Coral); //Flecha para mostrar el sentido del vector normal normalArrow = new TgcArrow(); showNormalModifier = AddBoolean("showNormal", "Show normal", true); Camera = new TgcRotationalCamera(new TGCVector3(0, 5, 0), 50f, Input); }
public override void Init() { cylinder = new TgcCylinder(TGCVector3.Empty, 2, 4); cylinder.AlphaBlendEnable = true; boundingCylinderModifier = AddBoolean("boundingCylinder", "boundingCylinder", false); colorModifier = AddColor("color", Color.White); alphaModifier = AddInt("alpha", 0, 255, 255); textureModifier = AddTexture("texture", MediaDir + "\\Texturas\\madera.jpg"); useTextureModifier = AddBoolean("useTexture", "useTexture", true); sizeModifier = AddVertex3f("size", new TGCVector3(-3, -3, 1), new TGCVector3(7, 7, 10), new TGCVector3(2, 2, 5)); positionModifier = AddVertex3f("position", new TGCVector3(-20, -20, -20), new TGCVector3(20, 20, 20), TGCVector3.Empty); var angle = FastMath.TWO_PI; rotationModifier = AddVertex3f("rotation", new TGCVector3(-angle, -angle, -angle), new TGCVector3(angle, angle, angle), TGCVector3.Empty); Camara = new TgcRotationalCamera(Input); }
public override void Init() { //FPS Camera Camera = new TgcFpsCamera(new TGCVector3(-140f, 40f, -50f), 200f, 200f, Input); //Modifier para habilitar o deshabilitar FrustumCulling cullingModifier = AddBoolean("culling", "Frustum culling", true); //UserVar para contar la cantidad de meshes que se renderizan UserVars.addVar("Meshes renderizadas"); //Cargar escena desde archivo ZIP var loader = new TgcSceneLoader(); tgcScene = loader.loadSceneFromZipFile("4toPiso-TgcScene.xml", MediaDir + "4toPiso\\4toPiso.zip", MediaDir + "4toPiso\\Extract\\"); /* * //Version para cargar escena desde carpeta descomprimida * TgcSceneLoader loader = new TgcSceneLoader(); * tgcScene = loader.loadSceneFromFile(this.MediaDir + "4toPiso\\Extract\\4toPiso-TgcScene.xml", this.MediaDir + "4toPiso\\Extract\\"); */ }
public override void Init() { this.time = 0; this.techniques = AddEnum("Tecnica", typeof(Techniques), Techniques.RenderMesh); this.rotation = AddFloat("Rotacion", 0, FastMath.TWO_PI, 0); this.factor = AddFloat("Factor", 0, 1, 0.5f); this.effectVector = AddVertex3f("Vector", new TGCVector3(-20, -20, -20), new TGCVector3(20, 20, 20), TGCVector3.Empty); this.center = AddVertex3f("Centro", new TGCVector3(-10, -10, -10), new TGCVector3(10, 10, 10), TGCVector3.Empty); this.wireframe = AddBoolean("Wireframe", "Prende el efecto wireframe", false); this.showArrow = AddBoolean("Vector del Efecto", "Muestra el vector del efecto", false); this.CreateEffect(); this.CreateMesh(); this.CreateArrow(); this.scale = TGCMatrix.Scaling(20, 20, 20); var cameraPosition = new TGCVector3(0, 0, 125); var lookAt = TGCVector3.Empty; Camara.SetCamera(cameraPosition, lookAt); }
public override void Init() { //Cargamos un escenario var loader = new TgcSceneLoader(); var scene = loader.loadSceneFromFile(MediaDir + "MeshCreator\\Scenes\\Deposito\\Deposito-TgcScene.xml"); meshes = scene.Meshes; InitializeLights(); InitializeRenderTargets(); InitializeEffect(); InitializeFullScreenQuad(); meshes.ForEach(mesh => mesh.Effect = deferredEffect); meshes.ForEach(mesh => mesh.Technique = "Deferred"); toggle = AddBoolean("Prender/Apagar", "Usar Deferred Rendering", true); visualizeRenderTargets = AddBoolean("Visualizar render targets", "Muestra o deja de mostrar los render targets", false); FixedTickEnable = true; Camera = new TgcFpsCamera(Input); }
public override void Init() { //Crear caja vacia box = new TGCBox(); //Crear caja debug vacia debugBox = new TgcBoxDebug(); currentTexture = null; //Modifiers para vararis sus parametros boxModifier = AddBoolean("box", "box", true); boundingBoxModifier = AddBoolean("boundingBox", "BoundingBox", false); debugBoxModifier = AddBoolean("debugBox", "debugBox", true); thicknessModifier = AddFloat("thickness", 0.1f, 5, 0.2f); textureModifier = AddTexture("texture", MediaDir + "\\Texturas\\madera.jpg"); offsetModifier = AddVertex2f("offset", new TGCVector2(-0.5f, -0.5f), new TGCVector2(0.9f, 0.9f), TGCVector2.Zero); tilingModifier = AddVertex2f("tiling", new TGCVector2(0.1f, 0.1f), new TGCVector2(4, 4), TGCVector2.One); colorModifier = AddColor("color", Color.BurlyWood); sizeModifier = AddVertex3f("size", TGCVector3.Empty, new TGCVector3(100, 100, 100), new TGCVector3(20, 20, 20)); positionModifier = AddVertex3f("position", new TGCVector3(-100, -100, -100), new TGCVector3(100, 100, 100), TGCVector3.Empty); rotationModifier = AddVertex3f("rotation", new TGCVector3(-180, -180, -180), new TGCVector3(180, 180, 180), TGCVector3.Empty); Camera = new TgcRotationalCamera(TGCVector3.Empty, 200f, Input); }