TASK 1:  Animated Sine Incurvation

Write a Python program individual.py with PyOpenGL to exhibit an airlines of sine power y=Asin(x+B), satifying the controlthcoming requirements:

  • The window contact’s largeness is (600, 600), and its upper-left retreat is at (250, 250) on the protect;
  • The window contact’s appellation is Animated Sine Incurvation.
  • The ranges of x and y are [-4, 4] (x is in radians);
  • The repletion A is a aimless transport in [1, 2], and it is updated each term the window contact restarts;
  • The front displace B is a transport; it is initialized as 0, and incremented by 0.01 each term the protect refreshes;
  • The brace axes are drawn in stainless, with an arrow towards the dogmatical curb at the purpose of each axis;
  • The sine incurvation is drawn in yellow.
  • Orthogonal protuberance is used in this subordinatetaking.

The controlthcoming likeness illustrates the expected window contact.

TASK 2:  Clamped B-Spline

 Write a Python program brace.py with PyOpenGL to exhibit a clamped B-spline, satifying the controlthcoming requirements:

  • The window contact’s largeness is (550, 550), and its upper-left retreat is at (150, 150) on the protect;
  • The window contact’s appellation is Special B-Splines.
  • The program reads a extract rasp denominated control-points.txt, including an x,y coordinate couple in each length as a curb apex, in the identical folder;
  • Curb apexs are drawn with largeness 4 in chill.
  • Based on the curb apexs, a clamped B-splength is drawn.
  • P(t)’s perversion, qualified by blushing and sky blue, depends on its flexion (R = flexion / 5, G = 0.0, B = 1 – flexion / 5);
  • Flexion is clipped by [0, 5].
  • Orthogonal protuberance is used in this subordinatetaking.

The controlthcoming likeness illustrates the expected window contact, balbutiation the exemplification control-points.txt supposing.

TASK 3:  Hexagonal Pyramid

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

  • The window contact’s largeness is (400, 400), and its upper-left retreat is at (100, 100) on the protect;
  • The window contact’s appellation is Hexagonal Pyramid.
  • The program reads a extract rasp denominated pyramid-params.txt, including individual length as x,y,z,H,R, in the identical folder, where x, y and z are the coordinates of the head vertex v, H is the exaltation, and R is the radius; we wear the head vertex v and the vile centroid c are on the identical upright axis, and c is frequently subordinate v; the separation betwixt c and any vile vertex vi is frequently R.
  • Based on the over advice, a hexagonal pyramid is drawn.
  • All faces are aimlessly and variously perversioned, bar control the vile in stainless.
  • When the clew R is pressed, the radis increases by 0.01 and the hexagonal pyramid is blushingrawn.
  • When the clew H is pressed, the exaltation decreases by 0.01 and the hexagonal pyramid is blushingrawn.
  • The hexagonal pyramid is static by default; When the clew X, Y or Z is pressed, the hexagonal pyramid toggles betwixt life static and rotating 1 degree/refresh parallel the identical axis (i.e., the clew X corresponds to the x axis), preliminary c as the source.
  • Perspective protuberance is used in this subordinatepreliminary (FoV is 90 degrees towards the y-axis; Camera looks at the source and uses the y-axis curb as the up-vector).

The controlthcoming likeness illustrates the expected window contact, balbutiation the exemplification pyramid-params.txt supposing.

~~~For this or similar assignment papers~~~