Here, we provide programs related to the field of Computer Graphics
- Perspective Transformation from scratch in Python.
- Hidden Surface Removal with Back-Face Culling in Python.
- Illumination models and surface reflections in Python.
- Triangle and Barycentric Coordinates in Python.
- Barycentric coordinates for triangle and texture mapping in Python.
- Point in polygon: Even-odd rule for inside-outside test for polygons in Python.
- Texture mapping for quadrilaterals using inverse bilinear interpolation in Python.
- Two-dimensional metaballs in Python.
- Chaos Game for Iterated Function System (IFS).
- The Mandelbrot set is a well-known fractal, which is based on a recursive complex function. Here, we review the formulation. Then, two versions of implementing the set with Python are provided.
- The Julia set is another famous fractal, which follows the behaviour of iterated functions. Here, we display the Julia set for a quadratic complex function. The Python code has two versions: a slow one and a fast one.
- Elementary cellular automatom: Elementary CA is used to create some patterns which are interesting. Here, we review these types of CA with Python code.
- Two-dimensional cellular automata are mentioned here. 2D CAs are used for creating patterns and simulating some simple life forms. Here, Python codes are used to creating some patterns with CAs.
- Perlin noise from scratch: We review Perlin noise and then implement it in Python. Perlin noise is used in Computer Graphics for creating terrains, mountains, clouds, and etc.
- Line segments and their intersections: A line segment is a part of a line limited by two endpoints. Here, we review the parametric form of line segments and express the formulas to compute the intersection points of line segments.
- Circles and their intersections: Three forms for representing circles are mentioned here. Based on the Cartesian coordinates form of circles, we state the formulas to find the intersection points between circles.
- Intersection between line segments and circles: This time we develop formulae to find the intersection between a line segment and a circle. The formulae are extendable to find the intersection between line segments and spheres. The Python code here is written for intersections between line segments and circles.
- Rose curves: Rose curves are two-dimensional curves defined in polar coordinates by using sine of cosine fucntions. Here, we review those curves and display them with different parameters.
- Line-Plane Intersection: Having a plane and a line in 3D, we are going to find at what point they intersect. A plane and a line may intersect at one point, or they are parallel. When they are parallel, if the line lies on the plane, we have countless intersections. On the other hand, if the parallel line to the plane does not lie on the plane, there will be no intersection. We demonstrate the mentioned topic with the Python code here.