In: Computer Science
Write the algorithm in pseudocode for scan-converting (filling in the interior) of an axis-aligned right triangle (the base is aligned with the x-axis and the orthogonal leg is aligned with the y-axis).
Answer.
Step 1
Pseudo code:
Declare
Read x //Base axis
Read y //Orthogonal leg
Read color //Color to fill the interior
//Defining scan_converting
Function scan_converting(Triangle T1, Color color)
//Filling interior based on pixel
For each pixel P1 at (x,y)
If (Inside (T1,P1))
setPixel(x,y,color)
End If
End Loop
End
Step 2
Explanation:
Kindly upvote please,
Thank you.