Rotating my boring flat Jupiter image into a 3D globe using WinJUPOS and vpython
Recently, the sky cleared up suddenly over in my place. Which was a rarity in itself. And since Jupiter is high up in the sky passing the meridian just before midnight, I grabbed that opportunity to image it just like any other night.
And then, I remember saw Micheal Philips old post about rendering Jupiter into a 3D globe and generate a fly-by video. I think I saw a tutorial somewhere in youtube, but simply couldn't find it. Either it has been removed, or I was just imagining it.. syyyy..
Luckily nowadays we have a new friend, ChatGPT to help with the research. after a lot of wrong prompts and refining the scope, I finally found a way.
So here it is
Step - 1 (Summary).
Generate the complete processed Jupiter photos as usual, using Autostakkert, Winjupos. I used imppg for sharpening (seems to be working much better than PixInsight! ), and back and forth to PixInsight for color balance and other cosmetic stuffs.
Step - 2. (Winjupos)
Open back the final TIF in Winjupos. Do Image Measurement on the image. Re-center and save the ims file as usual.
from vpython import sphere, rate, vector, canvas
# creating a 3D sphere with a texture from a cylindrical lambert map of Jupiter
# Create a variable for canvas size
canvas_size = 700 # Canvas width and height in pixels
# Specify the starting point of the image (rotation angle in radians)
start_angle = 1.5 # For example, 0.5 radians (~28.6 degrees)
# Create a larger canvas
scene = canvas(
width=canvas_size,
height=int(0.75 * canvas_size), # Maintain a 4:3 aspect ratio
center=vector(0, 0, 0),
background=vector(0, 0, 0) # Set black background
)
# Load the texture (your cylindrical map) and apply it to the sphere
globe = sphere(
radius=5, # Radius of the sphere
texture={"file": "maps/2025-01-02-1654.jpg"}, # Replace with your image file path
emissive=True # Make the sphere self-illuminated
)
# Apply the initial rotation angle
globe.rotate(angle=start_angle, axis=vector(0, 1, 0))
# Rotate the sphere continuously
while True:
rate(60) # Controls the speed of rotation (30 frames per second)
globe.rotate(angle=0.001, axis=vector(0,1,0)) # Rotate about the vertical axis (Y-axis)
Step - 6
Comments
Post a Comment