Explore
Courses
Batches
Sketches
Statistics
Code a Pookkalam
Jobs
Devsprint
People
Course Creation
Create a Course
Guidelines
Resources
Support
Blogs
My Profile
About Us
Login
Sketches
0
Raptor's 3d Balls
By
Aditya Aravind
Run
arr = [] # Func to apply transorm in array def applyTransform(arr, *trans): newArr = [] for i in arr: for j in trans: i = i | j newArr.append(i) return newArr def genSphere(n=80, r=230, g=20, b=20): shapes = [] step = 1/n for i in range(n): val = step * (i + 1) sVal = max(pow(val, 0.25), 0.1) clr = color(r * sVal, g * sVal , b * sVal) c = circle(r=100, fill=clr, stroke=clr) | scale(1 - val) shapes.append(c) return shapes sphere = applyTransform(genSphere(), translate(-140, 150)) sphere2 =applyTransform( sphere, translate(x=100), scale(0.5)) sphere3 =applyTransform( sphere, translate(y=-100, x=-60), scale(0.5)) sphere4 = applyTransform(genSphere(r=20, g=240, b=40), scale(0.8), translate(x=50)) sphere5 = applyTransform(genSphere(r=255, g=140, b=0), scale(0.6), translate(x=-50, y=-20)) arr= arr + sphere2 + sphere3 + sphere4 + sphere5 show(*arr)
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login