Neutron Star 3D Simulation: See the Universe's Extreme Objects

An interactive 3D simulation to help understand neutron stars, their properties, and how they behave.

Unity 3D C# Line Renderer Shader Graph Physics Simulation Particle Systems UI/UX Design Scientific Visualization Astrophysics

About This Project

Neutron stars are among the most amazing and extreme objects in space. They are very dense and have strong magnetic fields and spin very fast. It's hard to imagine them just by reading books. Our project is an interactive 3D simulation that helps you explore and understand these complex objects. You can change their size, heat, magnetic field, and how fast they spin to see what happens.

This tool is for students, teachers, and anyone who loves astronomy. It makes learning about neutron stars easier and more fun by letting you see and interact with them in a virtual world. It also helps scientists test their ideas and understand real observations better.

Neutron Star Simulation Concept

The Problem We Solved

Learning about neutron stars can be very difficult. Textbooks often use only words and diagrams, which don't show how dynamic and extreme these stars really are. This makes it hard for students to truly grasp ideas like their super density, strong magnetic fields, or fast spinning. Our simulation was created to break this barrier, offering a clear and engaging way to learn.

My Work & What I Did

As a key member of Group Number 10 for this Final Year Project, my main role was in creating and developing the core simulation model of the neutron star.

My responsibilities included:

My team members also played vital roles:

Together, our team turned complex science into a fun, educational, and accurate simulation.

Try Our Simulation!

While this project was developed in Unity, which isn't directly web-based like PhySim, we aim to provide a demo soon. For now, you can view videos and images of the simulation in action below.

See It In Action

A video showing the interactive features and visual effects of the simulation.

Main Features

Interactive 3D Model

  • A custom-made, scientifically accurate 3D model of a neutron star.
  • Allows you to change key properties like radius, temperature, magnetic field, and rotation speed in real-time.
  • Shows real-time visual changes as you adjust parameters.

Realistic Visual Effects

  • Star's color changes based on temperature (from red to blue for hotter stars).
  • Magnetic fields are shown with intense particle effects, showing their strength.
  • Smooth and fast rotation animations reflecting real pulsar dynamics.

Easy Controls & Interface

  • Simple sliders and input fields to control parameters.
  • Camera controls let you orbit around the neutron star to view it from all sides.
  • User-friendly main menu with clear navigation to different sections (Start, Formation, Instructions, About Us).

Strong Educational Tool

  • Helps bridge the gap between complex science and easy understanding.
  • Designed for high school and college-level physics students, but also easy for beginners.
  • Includes a section on how neutron stars are formed.

How It's Made (Technical Details)

Building the Simulation

This interactive 3D simulation was built using Unity 3D, which is a powerful platform for real-time graphics. We used C# as the programming language. The Universal Render Pipeline (URP) was used for optimized graphics.

The core logic involves updating the neutron star's appearance and behavior based on user input. For example, here's a simplified look at how the camera is controlled in the simulation:


// Simplified Camera Controller Script in Unity (C#)
public class CameraController : MonoBehaviour
{
    public Transform target; // The object to orbit around (our Neutron Star)
    public float distance = 50f; // How far the camera is from the star
    public float orbitSpeed = 10f; // Speed of orbiting with mouse

    private float currentX = 0f;
    private float currentY = 0f;

    void Start()
    {
        // Find the neutron star if not set
        if (target == null && GameObject.Find("NeutronStar") != null)
        {
            target = GameObject.Find("NeutronStar").transform;
        }
        // Set initial camera angles
        Vector3 angles = transform.eulerAngles;
        currentX = angles.y;
        currentY = angles.x;
    }

    void LateUpdate()
    {
        if (target == null) return;

        // Handle mouse input for orbiting
        if (Input.GetMouseButton(1)) // Right mouse button
        {
            currentX += Input.GetAxis("Mouse X") * orbitSpeed;
            currentY -= Input.GetAxis("Mouse Y") * orbitSpeed;
            currentY = Mathf.Clamp(currentY, -80f, 80f); // Limit vertical movement
        }

        // Calculate camera position and rotation
        Vector3 dir = new Vector3(0, 0, -distance);
        Quaternion rotation = Quaternion.Euler(currentY, currentX, 0);
        transform.position = target.position + rotation * dir;
        transform.rotation = rotation;
    }

    // Other functions for arrow key movement and zoom (as in your report)
    // ...
}
          
  • **Development Platform:** Built in Unity 3D, known for its strong real-time rendering.
  • **Programming Language:** C# was used for all the logic and controls.
  • **Graphics:** Used Universal Render Pipeline (URP) for optimized visuals and Shader Graph for advanced surface effects like temperature-based color changes.
  • **Interactive UI:** Designed with Unity's native UI system for a responsive and user-friendly experience across different screen sizes.
  • **Physics Logic:** The simulation's physics logic ensures that changing parameters (like radius and rotation speed) correctly affects the star's behavior.
  • **Particle Systems:** Used to visually represent complex phenomena like magnetic fields and high-energy emissions.

What I Learned

This Final Year Project was a huge learning journey for me. I gained new skills and improved existing ones:

3D Simulation Development

I learned how to build complex 3D interactive simulations using Unity, focusing on realistic physics and engaging visual effects.

Advanced Graphics Programming (Shaders)

I became skilled in using Shader Graph to create dynamic visual effects, like temperature-based color transitions and magnetic field visualizations.

Physics Integration in Software

I learned to translate real astrophysical data and theories into a working simulation, ensuring scientific accuracy in how parameters interact.

User Interface (UI) Design & Implementation

I gained practical experience in designing and implementing intuitive user interfaces that are easy to navigate and work well on different devices.

Collaborative Project Management

Working in a team, I learned how to divide tasks, collaborate effectively, and ensure a high-quality final product.

Deepening Physics Knowledge

This project greatly improved my understanding of neutron stars, their extreme properties, and complex astrophysical concepts.

Testing & Student Feedback

We tested the simulation with second-year physics students from NED University of Engineering and Technology to see how well it worked and how effective it was for learning.

Overall, 90% of participants confirmed that the physical phenomena were accurately shown, and about 95% would recommend the simulation to others, showing high satisfaction.

Future Ideas

This project has a lot of potential for future development:

Want to Work Together?

Do you need an expert in 3D simulations or educational technology? I love turning complex scientific ideas into clear, interactive, and engaging experiences.

Get in Touch