Planet3D


NamePlanet3D JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/ishanoshada/Planet3D
SummaryA 3D representation of the solar system using Pygame and OpenGL
upload_time2023-11-25 16:05:21
maintainer
docs_urlNone
authorIshan Oshada
requires_python
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Planet3D: Solar System Visualization


![ss](https://raw.githubusercontent.com/Ishanoshada/Ishanoshada/main/ss/7d42d195b24996b688b4e1641be0656e.png~tplv-jiivuhwl6u-resize_5000.awebp.webp)

## Introduction

Planet3D is a Python library that provides a simple yet powerful framework for visualizing a solar system in a 3D space. It utilizes the Pygame and OpenGL libraries to render planets, moons, and their orbits, allowing users to explore the celestial bodies of our solar system in an interactive 3D environment.

## Features

- **Realistic Rendering:** Planet3D employs OpenGL to create realistic 3D representations of planets and moons, complete with orbital paths.

- **Interactive Exploration:** Users can navigate through the solar system using keyboard controls, adjusting the viewpoint to observe planets and their orbits from different angles.

- **Configurability:** Easily customize the solar system by adding planets, moons, rings, and adjusting their properties such as size, orbit radius, rotation speed, and colors.

- **Fullscreen Mode:** Toggle between fullscreen and windowed modes for an immersive experience.

## Installation

Planet3D can be installed using the following command:

```bash
pip install Planet3D
```

## Getting Started

### Importing Planet3D

```python
from Planet3D import Planet, generate_solar_system
```

### Creating Planets

```python
# Create planets with specified properties
earth = Planet(name="Earth", radius=0.6, orbit_radius=12.0, rotation_speed=0.9, color=(0.0, 0.5, 1.0))
mars = Planet(name="Mars", radius=0.4, orbit_radius=18.0, rotation_speed=0.8, color=(1.0, 0.0, 0.0))
```

### Adding Moons

```python
# Add moons to a planet
earth.add_moon(name="Moon", radius=0.3, orbit_radius=3.0, rotation_speed=1.0, color=(0.8, 0.8, 0.8))
```

### Configuring Rings

```python
# Add rings to a planet
saturn.add_ring(radius=5.0, width=0.2, color=(0.8, 0.8, 0.8), transparency=0.3)
```

### Generating the Solar System

```python
# Generate and display the solar system
planets = [earth, mars]
generate_solar_system(planets)
```

To use Planet3D, create instances of the `Planet` class for each celestial body you want to include in the solar system. Customize properties such as radius, orbit radius, rotation speed, and color. Add rings or moons if desired. Finally, use the `generate_solar_system` function to display the solar system.

Here is a basic example:

```python
from Planet3D import Planet, generate_solar_system

if __name__ == "__main__":
    # Create instances of planets
    sun = Planet(name="Sun", radius=5.0, orbit_radius=0.0, rotation_speed=0.0, color=(1.0, 0.8, 0.0))
    mercury = Planet(name="Mercury", radius=0.2, orbit_radius=5.0, rotation_speed=5.0, color=(0.7, 0.7, 0.7))
    venus = Planet(name="Venus", radius=0.5, orbit_radius=8.0, rotation_speed=3.0, color=(0.9, 0.7, 0.0))
    # ... (create other planets)

    # Customize Saturn with rings
    saturn_rings_color = (0.8, 0.8, 0.8)
    saturn.add_ring(radius=5.0, width=0.2, color=saturn_rings_color, transparency=0.3)

    # Add Moon to Earth
    earth.add_moon(name="Moon", radius=0.3, orbit_radius=3.0, rotation_speed=1.0, color=(0.8, 0.8, 0.8))

    # List of planets in our solar system
    planets = [sun, mercury, venus, earth, mars, jupiter, saturn, uranus, neptune]

    # To run in fullscreen mode, set fullscreen=True
    generate_solar_system(planets, display=(1200, 800), fullscreen=False)
```

This example demonstrates how to create a solar system with various planets and customization options.

![ex](https://github.com/Ishanoshada/Ishanoshada/blob/main/ss/ple.png?raw=true)

## Controls

- **Left/Right Arrow:** Move left/right
- **Up/Down Arrow:** Move up/down
- **W/S:** Move forward/backward
- **Z/X:** Move up/down faster

## Fullscreen Mode

To run the visualization in fullscreen mode, simply pass `fullscreen=True` to the `generate_solar_system` function:

```python
generate_solar_system(planets, fullscreen=True)
```

## Acknowledgements

Planet3D utilizes the Pygame and OpenGL libraries to create an interactive 3D solar system visualization.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contact

For questions or support, please contact [ishan.kodithuwakku@gmail.com].

**Repository Views** ![Views](https://profile-counter.glitch.me/planet3D/count.svg)

Explore the wonders of our solar system with Planet3D!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ishanoshada/Planet3D",
    "name": "Planet3D",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Ishan Oshada",
    "author_email": "ishan.kodithuwakku@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/9a/14/33c0014b72fa1eb6f858a8a6c1cd224360294bd4ab84774361c7f1a0e2df/Planet3D-0.2.0.tar.gz",
    "platform": null,
    "description": "# Planet3D: Solar System Visualization\n\n\n![ss](https://raw.githubusercontent.com/Ishanoshada/Ishanoshada/main/ss/7d42d195b24996b688b4e1641be0656e.png~tplv-jiivuhwl6u-resize_5000.awebp.webp)\n\n## Introduction\n\nPlanet3D is a Python library that provides a simple yet powerful framework for visualizing a solar system in a 3D space. It utilizes the Pygame and OpenGL libraries to render planets, moons, and their orbits, allowing users to explore the celestial bodies of our solar system in an interactive 3D environment.\n\n## Features\n\n- **Realistic Rendering:** Planet3D employs OpenGL to create realistic 3D representations of planets and moons, complete with orbital paths.\n\n- **Interactive Exploration:** Users can navigate through the solar system using keyboard controls, adjusting the viewpoint to observe planets and their orbits from different angles.\n\n- **Configurability:** Easily customize the solar system by adding planets, moons, rings, and adjusting their properties such as size, orbit radius, rotation speed, and colors.\n\n- **Fullscreen Mode:** Toggle between fullscreen and windowed modes for an immersive experience.\n\n## Installation\n\nPlanet3D can be installed using the following command:\n\n```bash\npip install Planet3D\n```\n\n## Getting Started\n\n### Importing Planet3D\n\n```python\nfrom Planet3D import Planet, generate_solar_system\n```\n\n### Creating Planets\n\n```python\n# Create planets with specified properties\nearth = Planet(name=\"Earth\", radius=0.6, orbit_radius=12.0, rotation_speed=0.9, color=(0.0, 0.5, 1.0))\nmars = Planet(name=\"Mars\", radius=0.4, orbit_radius=18.0, rotation_speed=0.8, color=(1.0, 0.0, 0.0))\n```\n\n### Adding Moons\n\n```python\n# Add moons to a planet\nearth.add_moon(name=\"Moon\", radius=0.3, orbit_radius=3.0, rotation_speed=1.0, color=(0.8, 0.8, 0.8))\n```\n\n### Configuring Rings\n\n```python\n# Add rings to a planet\nsaturn.add_ring(radius=5.0, width=0.2, color=(0.8, 0.8, 0.8), transparency=0.3)\n```\n\n### Generating the Solar System\n\n```python\n# Generate and display the solar system\nplanets = [earth, mars]\ngenerate_solar_system(planets)\n```\n\nTo use Planet3D, create instances of the `Planet` class for each celestial body you want to include in the solar system. Customize properties such as radius, orbit radius, rotation speed, and color. Add rings or moons if desired. Finally, use the `generate_solar_system` function to display the solar system.\n\nHere is a basic example:\n\n```python\nfrom Planet3D import Planet, generate_solar_system\n\nif __name__ == \"__main__\":\n    # Create instances of planets\n    sun = Planet(name=\"Sun\", radius=5.0, orbit_radius=0.0, rotation_speed=0.0, color=(1.0, 0.8, 0.0))\n    mercury = Planet(name=\"Mercury\", radius=0.2, orbit_radius=5.0, rotation_speed=5.0, color=(0.7, 0.7, 0.7))\n    venus = Planet(name=\"Venus\", radius=0.5, orbit_radius=8.0, rotation_speed=3.0, color=(0.9, 0.7, 0.0))\n    # ... (create other planets)\n\n    # Customize Saturn with rings\n    saturn_rings_color = (0.8, 0.8, 0.8)\n    saturn.add_ring(radius=5.0, width=0.2, color=saturn_rings_color, transparency=0.3)\n\n    # Add Moon to Earth\n    earth.add_moon(name=\"Moon\", radius=0.3, orbit_radius=3.0, rotation_speed=1.0, color=(0.8, 0.8, 0.8))\n\n    # List of planets in our solar system\n    planets = [sun, mercury, venus, earth, mars, jupiter, saturn, uranus, neptune]\n\n    # To run in fullscreen mode, set fullscreen=True\n    generate_solar_system(planets, display=(1200, 800), fullscreen=False)\n```\n\nThis example demonstrates how to create a solar system with various planets and customization options.\n\n![ex](https://github.com/Ishanoshada/Ishanoshada/blob/main/ss/ple.png?raw=true)\n\n## Controls\n\n- **Left/Right Arrow:** Move left/right\n- **Up/Down Arrow:** Move up/down\n- **W/S:** Move forward/backward\n- **Z/X:** Move up/down faster\n\n## Fullscreen Mode\n\nTo run the visualization in fullscreen mode, simply pass `fullscreen=True` to the `generate_solar_system` function:\n\n```python\ngenerate_solar_system(planets, fullscreen=True)\n```\n\n## Acknowledgements\n\nPlanet3D utilizes the Pygame and OpenGL libraries to create an interactive 3D solar system visualization.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contact\n\nFor questions or support, please contact [ishan.kodithuwakku@gmail.com].\n\n**Repository Views** ![Views](https://profile-counter.glitch.me/planet3D/count.svg)\n\nExplore the wonders of our solar system with Planet3D!\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A 3D representation of the solar system using Pygame and OpenGL",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/ishanoshada/Planet3D"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0803dd3bc6cc6ef0686f9768890900b1ac2bad9d7df36eef1d167ee8f884a4e6",
                "md5": "3851a8e71d4091f3fb4dd1803cf423b9",
                "sha256": "27a48b96fd7de0d5849f2a709816332c5c05a42a730c036c47af3bf99e57f79a"
            },
            "downloads": -1,
            "filename": "Planet3D-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3851a8e71d4091f3fb4dd1803cf423b9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5357,
            "upload_time": "2023-11-25T16:05:19",
            "upload_time_iso_8601": "2023-11-25T16:05:19.453296Z",
            "url": "https://files.pythonhosted.org/packages/08/03/dd3bc6cc6ef0686f9768890900b1ac2bad9d7df36eef1d167ee8f884a4e6/Planet3D-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9a1433c0014b72fa1eb6f858a8a6c1cd224360294bd4ab84774361c7f1a0e2df",
                "md5": "560f46278a7d8ae44d853e4105c84766",
                "sha256": "24b03952a37d9e8b753b9e4d81bec872150c55e6692d3448cdc54765dae63d56"
            },
            "downloads": -1,
            "filename": "Planet3D-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "560f46278a7d8ae44d853e4105c84766",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5128,
            "upload_time": "2023-11-25T16:05:21",
            "upload_time_iso_8601": "2023-11-25T16:05:21.095190Z",
            "url": "https://files.pythonhosted.org/packages/9a/14/33c0014b72fa1eb6f858a8a6c1cd224360294bd4ab84774361c7f1a0e2df/Planet3D-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-25 16:05:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ishanoshada",
    "github_project": "Planet3D",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "planet3d"
}
        
Elapsed time: 0.28444s