I am needing to code a coffee mug in OpenGL using c++. I have found the coding for a tea kettle but we have been told we cannot use a tea kettle. I have attached a photo for reference. Thank you for any help you can provide!

note:hi dear this code written by my own I think it is correct if u have any doubts on this code free to ask me i explain one by one understand it carefully
#include <GL\glut.h>
GLfloat xRotated, yRotated, zRotated;
GLdouble size=1;
void display(void)
{
glMatrixMode(GL_MODELVIEW);
// clear the drawing buffer.
glClear(GL_COLOR_BUFFER_BIT);
// clear the identity matrix.
glLoadIdentity();
// traslate the draw by z = -4.0
// Note this when you decrease z like -8.0
the drawing will looks far , or smaller.
glTranslatef(0.0,0.0,-2,5);
Red color used to draw.
glColor3f(0.8, 0.2, 0.1);
// changing in transformation matrix.
// rotation about X axis
glRotatef(xRotated,1.0,0.0,0.0);
// rotation about Y axis
glRotatef(yRotated,0.0,1.0,0.0);
// rotation about Z axis
glRotatef(zRotated,0.0,0.0,1.0);
// scaling transfomation
glScalef(1.0,1.0,1.0);
// built-in (glut library) function , draw
you a coffeecup
glutSolidTeapot(size);
// Flush buffers to screen
glFlush();
// sawp buffers called because we are using
double buffering
// glutSwapBuffers();
}
void reshapeFunc(int x, int y)
{
if (y == 0 || x == 0)
return; //Nothing is visible then, so return
//Set a new projection matrix
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//Angle of view:40 degrees
//Near clipping plane distance: 0.5
//Far clipping plane distance: 20.0
gluPerspective(40.0,(GLdouble)x/(GLdouble)y,0.5,20.0);
glViewport(0,0,x,y); //Use the
whole window for rendering
}
void idleFunc(void)
{
yRotated += 0.01;
display();
}
int main(int argc,char **argv)
{
//Initialize GLUT
glutInit(&argc, argv);
//double buffering used to avoid flickering
problem in animation
glutInitDisplayMode(GLUT_SINGLE |
GLUT_RGB);
// window size
glutInitWindowSize(400,350);
// create the window
glutCreateWindow("Teapot Rotating
Animation");
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
xRotated = yRotated = zRotated =
30.0;
xRotated=33;
yRotated=40;
glClearColor(0.0,0.0,0.0,0.0);
//Assign the function used in
events
glutDisplayFunc(display);
glutReshapeFunc(reshapeFunc);
glutIdleFunc(idleFunc);
//Let start glut loop
glutMainLoop();
return 0;
}
I am needing to code a coffee mug in OpenGL using c++. I have found the coding for a tea kettle b...
I need help with this c++ code. This is my first computer
science course. I have not learned arrays but I am learning
vectors. I am also required to write this code without do loops or
any other form of advanced coding technique. Please help me figure
out this code using the basic coding techniques that you would find
in an introduction to cs. Thank you for your help, I don't even
know where to start :)
I am needing help with the last part of this code. I have gotten each part working correctly accept getting the menu options to work by input and getting to the right section. your help is appreciated. I am to the menu in the code is the display menu and need an loop to interact until they want to exit menu. The edit options only needs an output of "feature is not yet implemented." Due to length I did not...
I am running issues with these problems in MATHEMATICA
software Coding class. I have previously posted the same material
but have been getting answers in c++,Java, etc... I thank the great
minds on here but, I am ONLY FOCUSED WITH THE MATHEMATICA program.
I wanted to compare my work to confirm my progress. So please only
answers in Mathematica language. thank u
a. Using a while loop, prompt the user for to input 5 numbers (the input numbers should be...
I am needing some help figuring out the blanks. I have been
working on this problem for a couple of hours and was hoping
someone can walk me through it. Thank You
Exercise 4-26 (Algorithmic) (LO. 4) Determine the taxable amount of social security benefits for the following situations. If required, round your answers to the nearest dollar. If an amount is zero, enter "0". a. Erwin and Eleanor are married and file a joint tax return. They have adjusted...
Hey, I have this homework from my data structures class using java that I am having difficulties coding. I had to create an abstract class Shape, which contains two protected instance variables color(String) and filled(boolean). Getter and setter for all the instance variables, and toString(). Two abstract methods getArea() and getPerimeter(). The part that I am not sure how to code is: for the subclasses of Shape which are Circle and Rectangle I have to override the abstract methods getArea()...
Hello everyone! I am working on my assignment for C++ and I'm having a bit of trouble on the value producing functions, I am creating a program wherein I have to input a value and I need to create a function called square value where in it will square the value I have input. I cannot seem to figure out this part. Here is the code that I have so far, and thank you for any help. I greatly appreciate...
CODE ONE #include #include using namespace std; string x =" I am global"; // Global x int main() { string x = " I am local"; // Local x cout< cout<<::x< return 0; } CODE TWO #include #include using namespace std; string str = "i am global ";// global int main() { string srt = "i am local to main() ";//local to main() cout << str << "---" << ::str << "\n";// LINE 5555. int x=5; int y=6; if...
I need help with this code. Im using C++ coding. Non Recursive (iterative) Fibonacci Write a program that uses a for loop to calculate a Fibonacci sequence (NOT RECURSIVE!!!) up to a given position, starting with position 0. This function defines a Fibonacci sequence: If the number is 0, the function returns a 0 If the number is 1, the function returns a 1 If the number is higher than 1, it returns the sum of the previous two numbers...
I am confused about how to code this. I have tried multiple ways of coding this and nothing has worked for me. If someone could help that would be great thanks. /*Chess Board: You will also create 5 "lanes" of "pieces" and each lane has that number of pieces on it; i.e. lane 5 = 5 pieces, lane 4 = 4 pieces, etc. The user and the computer can take any number of pieces from one lane. The object is...
I have almost done with this code to Implement Huffman Coding. However I have an error at the "Heap<Tree>". Could anyone help with solving this issue, really appreciated. Thank you!! import java.util.Scanner; public class HuffmanEncoding { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a text: "); String text = input.nextLine(); int[] counts = getCharacterFrequency(text); // Count frequency System.out.printf("%-15s%-15s%-15s%-15s\n", "ASCII Code", "Character", "Frequency", "Code"); Tree tree = getHuffmanTree(counts); // Create a Huffman tree String[]...