please format code with </> button * homework policy * asking questions
Hello, I am learning processing through this intro course and we have an assignment where we need to make a triangle that spins and follows your mouse. I have figured all of the code except, because rotate() operates around the origin which I have set at translate (mouseX, mouseY), it rotates around a vertices. I need to have the rotational origin on the side of the shape.
Here is my code, I have done so much research for the past 5 hours and I have finally decided to ask for help. I have no idea ho to fix this problem.
angle = 0
def setup ():
size (600, 600)
def draw ():
background (0)
global angle
translate (mouseX , mouseY)
rotate (radians (angle))
fill(255)
beginShape ()
vertex(-50, 50)
vertex (50, 50)
vertex (0, 0)
endShape ()
angle += 0.5