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.



Step - 3 (Winjupos)

In the menu select Analysis > Map Computation


Step - 4 (Winjupos)

Load the ims file.
Under the projection type, choose Equirectangular projection. Initially I used the lambert cylindrical equal-area projection but the the final 3d globe looks really weird, like those photos from Juno probe.

Compile map


And... duhh... i forgot to remove the labels.


Going back to the original setup window, select Page Layout.


I changed the Page background and Map background to black. Unselect the scales, caption or any other labels.

Also, I changed the Map width to the whatever recommended by Winjupos. In this case 1736. 


 

Now this looks better. I will go back to photoshop to clean up the lines between the image and the background to make it more 'natural'. In this example I just leave as it is.



Step - 5 (Python)

I got the original code for vpython from a youtube channel, which I forgot to save!! After much fiddling with ChatGpt this one seems to be working just fine.


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

Run the code, and it will display the animated file in the browser! I'm still trying to figure out how to save it as mp4. At the moment I cheat... I just screen captured with quicktime.. haaaa 

Below is the result. This one was actually using a different image file, but you get the idea.

Good luck!



Comments

Popular posts from this blog

A Picture Perfect Moment!

I'm back... on blogspot!