Concept
Initially I wanted to recreate the Dubai Eye wheel, however due to complexity of the intricate structure of the wheel, I decided to channel my creativity and imagination to design a simpler but visually captivating ferris wheel. The core idea was to create a dynamic scene where a whimsical ferris wheel continuously rotates against a serene evening sky backdrop. This piece combines the charm of a classic carnival ride with the enchantment of a starry night, offering viewers a sense of nostalgia and wonder.
Highlights
class FerrisWheel { constructor(x, y, radius, cabins) { this.x = x; this.y = y; this.radius = radius; this.cabins = cabins; this.angle = 0; this.cabinWidth = TWO_PI / cabins; } update() { this.angle += 0.01; } display() { for (let i = 0; i < this.cabins; i++) { let cabinAngle = this.angle + i * this.cabinWidth; let cabinX = this.x + this.radius * cos(cabinAngle); let cabinY = this.y + this.radius * sin(cabinAngle); stroke(255); fill(220, 220, 220); line(cabinX, cabinY, this.x, this.y); fill(255); stroke(0); drawCabin(cabinX, cabinY); } } }
The highlight of my code would be the ferris wheel class itself. Initially, the cabins on my ferris wheel remained static, failing to mimic the natural rotation of a real ferris wheel. This static appearance detracted from the realism and overall visual appeal of the piece. figuring out the math behind making the cabins move as the wheels rotate made the entire piece look so much more realistic.
The update and display functions play the most important role here. In the “update” function, a subtle but crucial change occurs as the “angle” of the wheel is incrementally adjusted by 0.01 units with each frame update. This seemingly minor alteration is, in fact, the driving force behind the entire dynamic effect. The magic happens in the “display” function. Here, a loop iterates through each cabin, accurately calculating their positions based on the current wheel rotation angle. By incorporating trigonometric functions,”cos” and “sin,” the cabins are positioned equidistantly around the wheel’s circumference. This calculation ensures that each cabin moves synchronously with the wheel’s rotation.
Reflection
In hindsight, while my final art piece has achieved a significantly more lifelike representation, I think there is still room for improvement. If given the opportunity for further refinement, I would consider the addition of towering skyscrapers in the background. This addition would not only serve to augment the visual appeal of the artwork but also create a captivating juxtaposition between the timeless charm of the ferris wheel and the modern urban landscape, further enriching the narrative and depth of the composition.