From a3518f5df3522c4c9766b2db03a1cf51af261510 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sat, 24 Oct 2009 10:21:14 +0000 Subject: [PATCH] Plane.cs belongs to the 'old' structures. --- Source/Examples/Shapes/{ => Old}/Plane.cs | 108 +++++++++++----------- 1 file changed, 54 insertions(+), 54 deletions(-) rename Source/Examples/Shapes/{ => Old}/Plane.cs (96%) diff --git a/Source/Examples/Shapes/Plane.cs b/Source/Examples/Shapes/Old/Plane.cs similarity index 96% rename from Source/Examples/Shapes/Plane.cs rename to Source/Examples/Shapes/Old/Plane.cs index 633bcb0e..6fd0271d 100644 --- a/Source/Examples/Shapes/Plane.cs +++ b/Source/Examples/Shapes/Old/Plane.cs @@ -1,54 +1,54 @@ -#region --- License --- -/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos - * See license.txt for license info - */ -#endregion - -using System; -using System.Collections.Generic; -using System.Text; - -using OpenTK; - -namespace Examples.Shapes -{ - public class Plane : Shape - { - public Plane(int x_res, int y_res, float x_scale, float y_scale) - { - Vertices = new Vector3[x_res * y_res]; - Normals = new Vector3[x_res * y_res]; - Indices = new int[6 * x_res * y_res]; - Texcoords = new Vector2[x_res * y_res]; - - int i = 0; - for (int y = -y_res / 2; y < y_res / 2; y++) - { - for (int x = -x_res / 2; x < x_res / 2; x++) - { - Vertices[i].X = x_scale * (float)x / (float)x_res; - Vertices[i].Y = y_scale * (float)y / (float)y_res; - Vertices[i].Z = 0; - Normals[i].X = Normals[i].Y = 0; - Normals[i].Z = 1; - i++; - } - } - - i = 0; - for (int y = 0; y < y_res - 1; y++) - { - for (int x = 0; x < x_res - 1; x++) - { - Indices[i++] = (y + 0) * x_res + x; - Indices[i++] = (y + 1) * x_res + x; - Indices[i++] = (y + 0) * x_res + x + 1; - - Indices[i++] = (y + 0) * x_res + x + 1; - Indices[i++] = (y + 1) * x_res + x; - Indices[i++] = (y + 1) * x_res + x + 1; - } - } - } - } -} +#region --- License --- +/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos + * See license.txt for license info + */ +#endregion + +using System; +using System.Collections.Generic; +using System.Text; + +using OpenTK; + +namespace Examples.Shapes +{ + public class Plane : Shape + { + public Plane(int x_res, int y_res, float x_scale, float y_scale) + { + Vertices = new Vector3[x_res * y_res]; + Normals = new Vector3[x_res * y_res]; + Indices = new int[6 * x_res * y_res]; + Texcoords = new Vector2[x_res * y_res]; + + int i = 0; + for (int y = -y_res / 2; y < y_res / 2; y++) + { + for (int x = -x_res / 2; x < x_res / 2; x++) + { + Vertices[i].X = x_scale * (float)x / (float)x_res; + Vertices[i].Y = y_scale * (float)y / (float)y_res; + Vertices[i].Z = 0; + Normals[i].X = Normals[i].Y = 0; + Normals[i].Z = 1; + i++; + } + } + + i = 0; + for (int y = 0; y < y_res - 1; y++) + { + for (int x = 0; x < x_res - 1; x++) + { + Indices[i++] = (y + 0) * x_res + x; + Indices[i++] = (y + 1) * x_res + x; + Indices[i++] = (y + 0) * x_res + x + 1; + + Indices[i++] = (y + 0) * x_res + x + 1; + Indices[i++] = (y + 1) * x_res + x; + Indices[i++] = (y + 1) * x_res + x + 1; + } + } + } + } +}