private int Logos(char car, Vector3 alpha, Vector3 beta) { double en = energy(alpha, beta); Scroll data = Main.Archives.getScroll(0); foreach (Scroll archie in Main.Archives) { if (archie.Symbol.Equals(car)) { data = archie.Clone(); break; } } double points = 0; points += (500 - stat[4]) * data.Benefits[2]; //health points += stat[6] * data.Benefits[0]; //food points += stat[7] * data.Benefits[1]; //water if (points > 0) { } return((int)Math.Ceiling(points / en)); }
//public String Class; // Class //public char Type; //Symbol //public double Size; //Size //public double rotSpeed; //Rotation Speed //public Vector3 rotAxis; //Rotation Axis //public Scheme Tint; //Color Shading //public Texture Tex; //Texture //public Transparency Tran; //Transparency public Entity(Vector3 coor, Scroll dat) {//CREATE NEW ENTITY Pos = coor; data = dat; }
public static void Cube(int it, Entity ent) { Scroll data = ent.data; //Adjusts object position for centering double x = ent.Pos.X + data.UserSees[1] / -2; double y = ent.Pos.X + data.UserSees[1] / 2; double z = ent.Pos.X + data.UserSees[1] / 2; double rotA = (data.UserSees[0] * it) % 360;//sets rotation angle GL.PushMatrix(); GL.Translate(ent.Pos); //Moves object GL.Rotate(rotA, data.RotAxis.X, data.RotAxis.Y, data.RotAxis.Z); //Rotates object //Top GL.BindTexture(TextureTarget.Texture2D, data.Textr.getTop()); //Get texture GL.Begin(PrimitiveType.Quads); GL.Color4(Main.Colors[(int)data.UserSees[3]].getTop().R, Main.Colors[(int)data.UserSees[3]].getTop().G, Main.Colors[(int)data.UserSees[3]].getTop().B, data.UserSees[2]); //Set color and transparancy GL.TexCoord2(0.0f, 1.0f); GL.Vertex3(-data.UserSees[1] / 2, data.UserSees[1] / 2, data.UserSees[1] / 2); //Create Plane GL.TexCoord2(1.0f, 1.0f); GL.Vertex3(data.UserSees[1] / 2, data.UserSees[1] / 2, data.UserSees[1] / 2); GL.TexCoord2(1.0f, 0.0f); GL.Vertex3(data.UserSees[1] / 2, data.UserSees[1] / 2, -data.UserSees[1] / 2); GL.TexCoord2(0.0f, 0.0f); GL.Vertex3(-data.UserSees[1] / 2, data.UserSees[1] / 2, -data.UserSees[1] / 2); GL.End(); //Bottom GL.BindTexture(TextureTarget.Texture2D, data.Textr.getBottom()); GL.Begin(PrimitiveType.Quads); GL.Color4(Main.Colors[(int)data.UserSees[3]].getBottom().R, Main.Colors[(int)data.UserSees[3]].getBottom().G, Main.Colors[(int)data.UserSees[3]].getBottom().B, data.UserSees[2]); GL.TexCoord2(0.0f, 1.0f); GL.Vertex3(-data.UserSees[1] / 2, -data.UserSees[1] / 2, data.UserSees[1] / 2); GL.TexCoord2(1.0f, 1.0f); GL.Vertex3(-data.UserSees[1] / 2, -data.UserSees[1] / 2, -data.UserSees[1] / 2); GL.TexCoord2(1.0f, 0.0f); GL.Vertex3(data.UserSees[1] / 2, -data.UserSees[1] / 2, -data.UserSees[1] / 2); GL.TexCoord2(0.0f, 0.0f); GL.Vertex3(data.UserSees[1] / 2, -data.UserSees[1] / 2, data.UserSees[1] / 2); GL.End(); //Front GL.BindTexture(TextureTarget.Texture2D, data.Textr.getFront()); GL.Begin(PrimitiveType.Quads); GL.Color4(Main.Colors[(int)data.UserSees[3]].getFront().R, Main.Colors[(int)data.UserSees[3]].getFront().G, Main.Colors[(int)data.UserSees[3]].getFront().B, data.UserSees[2]); GL.TexCoord2(0.0f, 1.0f); GL.Vertex3(-data.UserSees[1] / 2, -data.UserSees[1] / 2, data.UserSees[1] / 2); GL.TexCoord2(1.0f, 1.0f); GL.Vertex3(data.UserSees[1] / 2, -data.UserSees[1] / 2, data.UserSees[1] / 2); GL.TexCoord2(1.0f, 0.0f); GL.Vertex3(data.UserSees[1] / 2, data.UserSees[1] / 2, data.UserSees[1] / 2); GL.TexCoord2(0.0f, 0.0f); GL.Vertex3(-data.UserSees[1] / 2, data.UserSees[1] / 2, data.UserSees[1] / 2); GL.End(); //Back GL.BindTexture(TextureTarget.Texture2D, data.Textr.getBack()); GL.Begin(PrimitiveType.Quads); GL.Color4(Main.Colors[(int)data.UserSees[3]].getBack().R, Main.Colors[(int)data.UserSees[3]].getBack().G, Main.Colors[(int)data.UserSees[3]].getBack().B, data.UserSees[2]); GL.TexCoord2(0.0f, 1.0f); GL.Vertex3(data.UserSees[1] / 2, -data.UserSees[1] / 2, -data.UserSees[1] / 2); GL.TexCoord2(1.0f, 1.0f); GL.Vertex3(-data.UserSees[1] / 2, -data.UserSees[1] / 2, -data.UserSees[1] / 2); GL.TexCoord2(1.0f, 0.0f); GL.Vertex3(-data.UserSees[1] / 2, data.UserSees[1] / 2, -data.UserSees[1] / 2); GL.TexCoord2(0.0f, 0.0f); GL.Vertex3(data.UserSees[1] / 2, data.UserSees[1] / 2, -data.UserSees[1] / 2); GL.End(); //Left GL.BindTexture(TextureTarget.Texture2D, data.Textr.getLeft()); GL.Begin(PrimitiveType.Quads); GL.Color4(Main.Colors[(int)data.UserSees[3]].getLeft().R, Main.Colors[(int)data.UserSees[3]].getLeft().G, Main.Colors[(int)data.UserSees[3]].getLeft().B, data.UserSees[2]); GL.TexCoord2(0.0f, 1.0f); GL.Vertex3(-data.UserSees[1] / 2, -data.UserSees[1] / 2, -data.UserSees[1] / 2); GL.TexCoord2(1.0f, 1.0f); GL.Vertex3(-data.UserSees[1] / 2, -data.UserSees[1] / 2, data.UserSees[1] / 2); GL.TexCoord2(1.0f, 0.0f); GL.Vertex3(-data.UserSees[1] / 2, data.UserSees[1] / 2, data.UserSees[1] / 2); GL.TexCoord2(0.0f, 0.0f); GL.Vertex3(-data.UserSees[1] / 2, data.UserSees[1] / 2, -data.UserSees[1] / 2); GL.End(); //Right GL.BindTexture(TextureTarget.Texture2D, data.Textr.getRight()); GL.Begin(PrimitiveType.Quads); GL.Color4(Main.Colors[(int)data.UserSees[3]].getRight().R, Main.Colors[(int)data.UserSees[3]].getRight().G, Main.Colors[(int)data.UserSees[3]].getRight().B, data.UserSees[2]); GL.TexCoord2(0.0f, 1.0f); GL.Vertex3(data.UserSees[1] / 2, -data.UserSees[1] / 2, data.UserSees[1] / 2); GL.TexCoord2(1.0f, 1.0f); GL.Vertex3(data.UserSees[1] / 2, -data.UserSees[1] / 2, -data.UserSees[1] / 2); GL.TexCoord2(1.0f, 0.0f); GL.Vertex3(data.UserSees[1] / 2, data.UserSees[1] / 2, -data.UserSees[1] / 2); GL.TexCoord2(0.0f, 0.0f); GL.Vertex3(data.UserSees[1] / 2, data.UserSees[1] / 2, data.UserSees[1] / 2); GL.End(); GL.PopMatrix(); }