Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphics: Add rings to gas giants #90

Open
StefanDeYoung opened this issue Jun 21, 2020 · 4 comments
Open

Graphics: Add rings to gas giants #90

StefanDeYoung opened this issue Jun 21, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@StefanDeYoung
Copy link
Contributor

Add ring structures to the solar system gas giants. Spectacle! Realism!

@StefanDeYoung StefanDeYoung added the enhancement New feature or request label Jun 21, 2020
@StefanDeYoung
Copy link
Contributor Author

You would think that the vpython.ring() object would be perfect. Unfortunately, vpython.ring() is a torus rather than a flat ring. So far, my best guess is a circular extrusion with a circular cutout:

#PLANET
saturn = sphere(pos=vector(0,0,0), texture='saturnmap.jpg', radius=1)

#RINGS
outer_circ = shapes.circle(radius=1.116saturn.radius)
inner_circ = shapes.circle(radius=2.327
saturn.radius)
ring_thickness = 8.29e-6
expath = [vec(0,0,-ring_thickness/2), vec(0,0,ring_thickness/2)]

ex = extrusion(path=expath,shape=[outer_circ,inner_circ],texture='saturn_circle.png')

@StefanDeYoung
Copy link
Contributor Author

StefanDeYoung commented Jun 21, 2020

I opened a question in the vpython group. Bruce Sherwood provided the following response: https://groups.google.com/d/msgid/vpython-users/af60d67a-e448-49ae-b646-67f292fe92d9o%40googlegroups.com?utm_medium=email&utm_source=footer

I generated some rings like this:

scene.width = scene.height = 1000
for r in arange(0.1, 5, 0.1):
c = color.hsv_to_rgb(vec(random(),1,1))
ring(radius=r, thickness=0.02, axis=vec(0,0,1), color=c)
scene.pause()
scene.capture('rings')

It looks like this:

Then moved rings.png from Downloads to my program folder and executed this:

extrusion(path=[vec(0,0,0), vec(0,0,1)],
shape=[shapes.circle(radius=10), shapes.circle(radius=5)],
texture='rings.png')

It looks like this:

What I don't know is how to take an arbitrary image and manipulate its formatting. But my experience suggests that if you can find some way to display the image you want, in some app or other, you could capture that image and use it in the extrusion.

Bruce

@StefanDeYoung
Copy link
Contributor Author

I downloaded the saturn map and saturn ring color from: http://planetpixelemporium.com/saturn.html
saturnmap
saturnringcolor

I used the tiled clones feature in inkscape to revolve the saturn ring colour image
saturn_circle

Based on Bruce's response, I think I can make a texture in inkscape by revolving the saturn ring color image, but I need to leave a circular hole in the middle that is the same size as the circular cutout.

@pmelanson
Copy link
Member

bless bruce, he's a great guy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants