Question: Create a lisp code that can follow the below requirements. Define the Point class to represent a point in 3 D space with (
Create a lisp code that can follow the below requirements.
Define the Point class to represent a point in D space with x y z coordinates.
Define the Color class to represent RGBA color with r g b a values.
Define the Shape class with properties for points, fill color, stroke color, stroke width, and a boolean isClosed.
Implement the Scene class with a list of shapes and a background color.
Implement factory functions to create instances of the shapes listed:
makeshape points &key isclosed?
makesquare length
makerectangle width length
makepentagon diameter
makehexagon diameter
makeheptagon diameter
makeoctagon diameter
makecircle diameter numpoints
makespiral diameter numloops numpoints
makesinecurve diameter numpoints
Implement the following methods in the Shape class for transforming shapes:
defmethod moveshapeby shape shapeoffset point
defmethod rotateshapeby shape shapeangle number
defmethod scaleshapeby shape shapescale point
defmethod randomizeshapepoints shape shapedelta number
adds a random value in the range delta, delta to the coordinates of each shape point
Use OpenGL calls to draw shapes in the scene.
Generate procedural scenes using code to create patterns and shapes, then capture screenshot images at x resolution.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
