/* These are the object function declarations for the f07 library. ================================================================ */ // ================================================================ // Natasha Kellaway // ================================================================ // *********** Natasha Kellaway's Objects for the object library ************ // Function: Draws a drumkit cymbal, with or without a stand /* The scale of the cymbal can be chosen by the user.The bigger the scaleFactor, the bigger the cymbal becomes. The color of the cymbal is automatically gold. The user can decide whether or not the cymbal has a stand. nkellawCymbal takes the parameters in the following order: 1. if the cymbal has a stand 2. stand height (only important if the cymbal has a stand) The initial view is looking at the cymbal from the bottom. So, if it has a stand, the initial view is looking at the bottom of the stand with the length of the stand and the cymbal going back along the z-axis. If the user specifies that a stand is present, the color of the stand is automatically black. The color of the stand is automatically black. The origin lies at the center at the center of the stand. */ void nkellawaCymbal(bool hasStand, GLfloat standHeight); // Function: Draws a drumstick /* The length of the drumstick can be chosen by the user. The color of the drumstick is automatically light brown. The user can decide whether or not the cymbal has a stand. The only argument for nkellawaDrumstick is: 1. the length The initial view is looking at the cymbal from the bottom. Of the drumstick. The shaft and tip of the drumstick point back along the z-axis. The origin lies in the center of the drumstick shaft. */ void nkellawaDrumstick(GLfloat length); // Function: Draws a snare drum, with or without legs /* The radius of the drum head and the height of the drum can be chosen by the user. Also, the color of the drum head and the side of the drum can be chosen by the user. The user can decide whether or not the drum has legs. It takes the parameters in the following order: 1. radius of drum head 2. height of drum 3. color of drum heads 4. color of drum side 5. if the drum has legs The initial view shows only the top drum head, with the body (and legs) pointing back along the z-axis. The original lies at the center of the bottom drum head. nkellawaSnareDrum employs a helper method called nkellawaDrumLeg if the user specifies that they want legs on the drum. nkellawaDrumLeg takes five parameters in the following order: 1. x-axis translation of the drum leg 2. y-axis translation of the drum leg 3. z-axis translation of the drum leg 4. radius of the drum 5. height of the drum The color of the legs is automatically black. */ void nkellawaSnareDrum(GLfloat radius, GLfloat height, twTriple headColor, twTriple sideColor, bool hasLegs); /* Function: Draws a drum kit including: a stool, a snare drum, a floor tom 2 wing toms,a bass drum, a ride cymbal, a crash cymal, and a hi-hat nkellawaDrumkit takes the parameters in the following order: 1. color of the drum heads 2. color of the drum sides 3. color of the stool seat 4. radius of the snare drum 5. height of the snare drum 6. height of the right (ride) cymbal The user gets to choose the color scheme of the drumkit. Once the user chooses the snare drum radius and height, the other 4 drums' (bass, floor tom, left wing tom, right wing tom) dimensions are based off of these measurements. Likewise, the user can choose the height of the right (ride) cymbal, and the other 2 cymbals' (ride cymbal and hi-hat) dimensions are based off of that. nkellawaDrumkit takes advantage of 2 helper methods -- nkellawaSnareDrum and nkellawaCymbal -- each which use a helper method to draw the legs and stands respectively. The details for these helper methods are stored in nkellawaSnareDrum.cc and nkellawaCymbal.cc, as these two components specify 2 particular objects. */ void nkellawaDrumkit(twTriple headDrumColor, twTriple sideDrumColor, twTriple seatColor, GLfloat snareRadius, GLfloat snareHeight, GLfloat rightCymbalHeight); // ================================================================ // Maui Moore // ================================================================ /* file name: mmoore2.h written by: maui moore date: 26 October 2007 description: file containing documentation and declaration of a function that draws a palm tree for a maui-like environment :) Copyright (C) 2007 by Marielle Moore under the GNU GPL */ // This function draws a palm tree with palm fronds of palmColor1, palmColor2 // and palmColor3. These should be expressed as triples of floating point // numbers specifying RGB colors, as should the params coconutColor and // trunkColor. // The trunk of the tree is conical, so treeHeight is actually meant to be // the height of the cone. treeBase is the width of the cone at the base. // The palm fronds are also conical. They are 2/3 the height of the tree in // length and their bases are half of the base of the trunk. // The tree appears in the left corner of the bounding box where the x and // z coords of the base of the tree are a function of the height of the tree // and where y = 0. // the model also contains two coconuts, one attached to the tree and one // on the ground to the right of the tree. The diameter of the coconuts is // a function of the radius of the base of the trunk of the tree. void mmoore2DrawPalmTree(twTriple palmColor1,twTriple palmColor2, twTriple palmColor3, twTriple coconutColor, twTriple trunkColor, int treeBase, int treeHeight); /* This file is part of moore2-PalmTree. moore2-PalmTree is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. moore2-PalmTree is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with moore2-PalmTree. If not, see . */ // This function draws a palm tree with palm fronds of palmColor1, palmColor2 // and palmColor3. These should be expressed as triples of floating point // numbers specifying RGB colors, as should the trunkColor. // The trunk of the tree is a stack of cones. treeBase is the width of each // cone at the base. The palm fronds are also conical. // They are 2/3 the height of the tree in // length and their bases are half of the base of the trunk. // The tree appears in the left corner of the bounding box where the x and // z coords of the base of the tree are a function of the height of the tree // and where y = 0. void mmoore2LitPalmTree(twTriple palmColor1,twTriple palmColor2, twTriple palmColor3, twTriple coconutColor, twTriple trunkColor, float treeBase, int treeHeight); // ================================================================ // Jackie Shaw // ================================================================ /* Jacquelin Shaw's OpenGL Guitar Copyright (c) 2007 Jacquelin Shaw This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . drawGuitar(float scale); Draws a gutiar This can be used by placing it in any kind of scene, room, with other instruments, etc. Every point and value is relative to the radius of the guitar's hole. it is resized by an affine transformation, and the only method that requries a parameter is the drawGuitar method. Therefore, the size of the guitar will be determined by the input. A radius of 1 will result in a guitar of 9.5 units in height. Any input will become a multiple of that, or in other words, any number you submit as the "scale" is the radius. The origin of the guitar is at the center of the guitar's hole. No matter what the size of the radius, the guitar will always be drawn starting at the center of your current coordinate system's origin. */ void drawGuitar(float scale); void drawGuitar2(float scale); // ================================================================ // Christina Pong // ================================================================ //Origami Crane by Christina Pong // //cpongOrigamiCrane(); //Draws an origami crane. //By default, you see the crane from the side with the head facing toward the right. //Values are scaled based on the head. Crane can be scaled via affine transformations. //Default color at the moment is shades of white. Lighting will be added soon. //The origin is the bottom of the crane so the crane can be placed on a surface. //In the event that you want to hang the crane off an object via the top of the body, //the body of the crane is 25/3 units high and you can translate down by that amount. void cpongOrigamiCrane(); //v2 //Origami Crane by Christina Pong // //cpongOrigamiCrane2(); //Draws an origami crane. //By default, you see the crane from the side with the head facing toward the right, down the //negative X axis. The tail points down the positive Y axis. Values are scaled based on the head, //which starts with a size of 10 units. The crane can be scaled via affine transformations. //Color is defined by the user through the craneColor agrument. The origin is the // bottom center of the crane (0,0,0) so the crane can be placed on a surface. In the event //that you want to hang the crane off an object via the top of the body, the body of the //crane is 25/3 units high and you can translate down by that amount. void calcNormal(twTriple craneA, twTriple craneB, twTriple craneC); void cpongOrigamiCrane2(twTriple craneColor); /* ================================================================ ......Micquie Bradford's Object for the Object Library...... Function: Draws a table fan whose blades can rotate. The color of the base of the fan can be chosen by the user. mbradforDrawFan takes only 2 parameters, the base color (in the form of a twTriple), and the initial rotation angle of the fan blades (in the form of a GLfloat). */ void mbradforDrawFan(twTriple fanColor,GLfloat rotA);