Describe the animated sine curve

Assignment Help Computer Engineering
Reference no: EM132628935

Assignment: Task 1: Animated Sine Curve

Write a Python program one.py with PyOpenGL to display an animation of sine function y = Asin(x+B), satifying the following requirements:

• The window application's size is (600, 600), and its upper-left corner is at (250, 250) on the screen;

• The window application's title is Animated Sine Curve.

• The ranges of x and y are [-4, 4] (x is in radians);

• The amplitude A is a random float in [1, 2], and it is updated each time the window application restarts;

• The phase shift B is a float; it is initialized as 0, and incremented by 0.01 each time the screen refreshes;

• The two axes are drawn in white, with an arrow towards the positive direction at the end of each axis;

• The sine curve is drawn in yellow.

• Orthogonal projection is used in this task.

The following figure illustrates the expected window application.

Task 2: Clamped B-Spline

Write a Python program two.py with PyOpenGL to display a clamped B-spline, satifying the following requirements:

• The window application's size is (550, 550), and its upper-left corner is at (150, 150) on the screen;

• The window application's title is Special B-Splines.

• The program reads a text file named control-points.txt, including an x,y coordinate pair in each line as a control point, in the same folder;

• Control points are drawn with size 4 in green.

• Based on the control points, a clamped B-spline is drawn.

• P(t)'s color, mixed by red and blue, depends on its curvature (R = curvature / 5, G = 0.0, B = 1 - curvature / 5);

• Curvature is clipped by [0, 5].

• Orthogonal projection is used in this task.

The following figure illustrates the expected window application, reading the sample control-points.txt provided.

Task 3: Hexagonal Pyramid

Write a Python program three.py with PyOpenGL to display a 3D hexagonal pyramid, satifying the following requirements:

• The window application's size is (400, 400), and its upper-left corner is at (100, 100) on the screen;

• The window application's title is Hexagonal Pyramid.

• The program reads a text file named pyramid-params.txt, including one line as x,y,z,H,R, in the same folder, where x, y and z are the coordinates of the top vertex v, H is the height, and R is the radius; we assume the top vertex v and the base centroid c are on the same vertical axis, and c is always under v; the distance between c and any base vertex vi is always R.

• Based on the above information, a hexagonal pyramid is drawn.

• All faces are randomly and differently colored, except for the base in white.

• When the key R is pressed, the radis increases by 0.01 and the hexagonal pyramid is redrawn.

• When the key H is pressed, the height decreases by 0.01 and the hexagonal pyramid is redrawn.

• The hexagonal pyramid is static by default; When the key X, Y or Z is pressed, the hexagonal pyramid toggles between being static and rotating 1 degree/refresh along the corresponding axis (i.e., the key X corresponds to the x axis), taking c as the origin.

• Perspective projection is used in this task (FoV is 90 degrees towards the y-axis; Camera looks at the origin and uses the y-axis direction as the up-vector).

The following figure illustrates the expected window application, reading the sample pyramid-params.txt provided.

Reference no: EM132628935

Questions Cloud

What the estimated direct labor-hours at the beginning : If the predetermined overhead rate, What the estimated direct labor-hours at the beginning of the year used in the predetermined overhead rate must have been
Which is the best or most adequate approach to morality : Which is the best or most adequate approach to morality: egoism, utilitarianism, or deontology? Why?
Notable ethical theories on the topic of justice : Relate one's moral framework to notable ethical theories on the topic of justice.
What journal entry to record the purchase of raw materials : During the month, the Corporation purchased an additional $83,000 of raw materials. The journal entry to record the purchase of raw materials would include a
Describe the animated sine curve : Write a Python program one.py with PyOpenGL to display an animation of sine function y = Asin(x+B), satifying the following requirements.
Compute for the expected maintenance cost for june : Using the least-squares regression method, compute for the expected maintenance cost for June if expected labor hours is 150 hours.
Balanced Scorecard for Mercy Hospital : Look at the Balanced Scorecard for Mercy Hospital. Use Memorandum format and direct it to your faculty.
Plot the data on a graphing paper : Using the scattergraph method, derive a cost formula for utilities cost. Use your cost formula to predict the utilities cost if 5,200 meals are served.
Explain the causes of the french revolution : Explain the causes of the French Revolution. Why did Louis XVI call a meeting of the Estates-General in May 1789?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd