Skip to main content
CodeSpeedTest
Languages
Start TypingJump into a test — pick any languageAdaptive TrainingUnlock chars as you master themPractice DrillsFocused sessions targeting weak spotsDaily ChallengesNew coding challenges every dayRace ModeCompete against others in real timeAI OpponentRace against an AI at your WPM levelTournamentsLive coding speed tournamentsArcade GamesZType, Overkill Survival, Glyphica & moreGamificationXP, coins, badges & quests
LeaderboardGlobal rankings for every languageCertificatesEarn verifiable Bronze / Silver / Gold certsActivityDaily streaks & historical analyticsProfileYour stats, badges & achievements
Browse Languages500+ languages with real code examplesBlogTips, guides & deep divesFree ToolsWPM calculator, typing speed report & moreFAQCommon questions answeredGetting StartedNew to CodeSpeedTest?AboutOur story & missionSupportGet help — Pro users get priorityContactGet in touch with the team
Pricing
  1. Home
  2. /
  3. Learn
  4. /
  5. Panda3d

Learn Panda3d - 10 Code Examples & CST Typing Practice Test

Panda3D is an open-source, cross-platform game engine primarily for Python and C++ that supports 3D rendering, physics, audio, input, networking, and VR/AR applications. It is designed for both educational and commercial projects, with a focus on rapid prototyping and full-featured 3D game development.

View all 10 Panda3d code examples →
Panda3D Keyboard Movement BoxPanda3D Rotating CubePanda3D Change Color on ClickPanda3D Simple Jumping ObjectPanda3D Mouse-Following SpritePanda3D 3D Camera OrbitPanda3D Toggle VisibilityPanda3D Spin On Key HoldPanda3D Resize ModelPanda3D Auto Forward Motion

Learn PANDA3D with Real Code Examples

Updated Nov 24, 2025

Explain

Panda3D uses Python for scripting and C++ for performance-critical components, making it easy to develop games quickly.

It includes a scene graph system, advanced rendering pipeline, shader support, physics integration, audio engine, input handling, and networking capabilities.

Panda3D is used for 3D games, simulations, VR/AR apps, educational tools, and visualization projects across desktop, mobile, and web platforms.

Core Features

Scene management via NodePath hierarchy

Rendering pipeline with OpenGL/DirectX

Animations and skeletal rigs

Particle systems

Audio and input handling

Basic Concepts Overview

ShowBase: main game/app class

NodePath: scene graph node wrapper

Tasks: recurring updates

Events: input handling and signals

Actor: animated 3D models

Project Structure

main.py - entry point

models/ - 3D assets

textures/ - image assets

scripts/ - game logic

shaders/ - GLSL files

Building Workflow

Initialize ShowBase

Load models into NodePaths

Attach tasks for updates

Handle input and events

Render scene and deploy

Difficulty Use Cases

Beginner: simple 3D scene rendering

Intermediate: interactive simulations

Advanced: complex games with physics/AI

Expert: VR/AR applications

Enterprise: research visualizations

Comparisons

Panda3D vs Unity: Python scripting vs C# editor-driven workflow

Panda3D vs Godot: Python-first 3D engine vs GDScript editor

Panda3D vs Unreal Engine: lightweight Python-based vs full AAA engine

Panda3D vs Blender Game Engine: dedicated 3D engine vs embedded tool

Panda3D vs Ogre3D: Python-friendly vs C++ rendering engine

Versioning Timeline

2002 - Initial release by Disney VR

2005 - Open-source release

2010 - Python 3 support

2016 - Bullet physics integration

2025 - Modern Python and shader improvements

Glossary

Scene Graph: hierarchical object organization

Actor: animated 3D model

NodePath: reference to a node

Task Manager: manages recurring functions

Shader: GPU program for rendering

Installation Setup

Install Python 3.8+

Install Panda3D via pip: pip install panda3d

Optionally install C++ SDK for performance

Set up environment variables if needed

Run sample programs to verify setup

Environment Setup

Install Python 3.8+

pip install panda3d

Install C++ SDK optionally

Set environment variables

Run samples to verify

Config Files

main.py

models/ directory

textures/ directory

shaders/ directory

requirements.txt for dependencies

Cli Commands

python main.py

ppython -m panda3d tools

panda3d-packager

deploy scripts

run samples

Internationalization

Multi-language string tables

Unicode support

Dynamic language switching

Localized assets

Formatted text rendering

Accessibility

Keyboard navigation

High contrast textures

Adjustable camera controls

Localization-friendly GUI

Subtitles and audio cues

Ui Styling

DirectGUI widgets

Custom 3D HUD

Bitmap fonts

Texture mapping

Shader-based effects

State Management

NodePath variables

Singleton classes for global state

Task manager updates

Event handlers

Persistent storage (JSON/SQLite)

Data Management

Models and textures

JSON for config

SQLite or file storage

Networked game data

Scene serialization

Architecture

ShowBase -> main application class

NodePath -> scene graph node

Model -> 3D model loaded into scene

Task manager -> updates and game loop

Camera and lights -> scene rendering control

Rendering Model

Forward rendering pipeline

Scene graph traversal

Hardware shaders

Lighting and shadows

Batching and instancing

Architectural Patterns

Scene graph hierarchy

Task-driven game loop

Event-based input

Actor animation system

Shader-based rendering

Real World Architectures

3D educational apps

VR training simulations

Research visualizations

Python AI simulations

Indie 3D games

Design Principles

Python-first development

Cross-platform 3D engine

Scene graph architecture

Flexible and extensible

Rapid prototyping support

Scalability Guide

Optimize models and textures

Use level-of-detail (LOD)

Cull unseen objects

Batch geometry where possible

Reduce physics iterations

Migration Guide

Update Python 2 code to Python 3

Replace deprecated API calls

Adjust shader files for modern OpenGL

Update Actor animations

Test cross-platform deployment

Performance Notes

Use flattened scene graphs for optimization

Optimize textures and models

Cull invisible objects

Use hardware shaders

Batch geometry where possible

Security Notes

Avoid loading untrusted scripts

Validate network input

Use secure file handling

Protect API keys

Limit file system access

Monitoring Analytics

FPS and memory counters

Custom logging via Python

Integrate analytics libraries

Debug visualization

Profiling tasks and shaders

Code Quality

Separate logic from scene definitions

Use Python classes for structure

Organize tasks efficiently

Keep NodePath hierarchy clean

Comment shaders and scripts

Practical Examples

3D maze exploration game

Physics-based simulation

Virtual classroom for education

VR walkthroughs

Real-time 3D visualization for research

Troubleshooting

Fix missing model paths

Resolve OpenGL context errors

Check texture formats

Handle shader compilation issues

Debug task manager loops

Testing Guide

Test rendering performance

Verify task execution timing

Check physics interactions

Test on multiple platforms

Debug shader/material issues

Deployment Options

Windows executable

macOS app bundle

Linux binaries

Web via WebAssembly (experimental)

VR/AR platforms

Tools Ecosystem

Panda3D SDK

Panda3D Samples and Templates

YABEE (Blender exporter)

Bullet physics engine

Panda3D ShaderPipeline

Integrations

Bullet physics for rigid bodies

OpenAL audio

VR headsets via OpenVR

Networking via Twisted or sockets

Python libraries for AI and data

Productivity Tips

Use task manager wisely

Keep NodePath tree organized

Leverage Python for rapid iteration

Batch models and textures

Debug visually with Panda3D tools

Challenges

Create a 3D maze

Animate a character

Add physics interactions

Implement camera controls

Build and distribute a desktop app

Learning Path

Learn Python basics

Understand scene graph and NodePaths

Load and animate models

Add physics and tasks

Deploy applications on desktop

Skill Improvement Plan

Week 1: ShowBase, NodePath basics

Week 2: Load models, apply textures

Week 3: Animation and Actor classes

Week 4: Physics and input handling

Week 5: Build and deploy applications

Interview Questions

What is ShowBase in Panda3D?

How does the scene graph work?

Difference between NodePath and Actor?

How are tasks managed?

How do you handle input events?

Cheat Sheet

ShowBase = main app

NodePath = scene node

Actor = animated model

Task = recurring update

Render = scene display

Books

Panda3D 3D Game Development

Learning Panda3D

Panda3D Game Engine Programming

Python Game Development with Panda3D

3D Python Game Programming

Tutorials

Panda3D official tutorials

Python Panda3D crash courses on YouTube

Udemy Panda3D courses

Panda3D sample programs

Community-driven guides

Official Docs

https://docs.panda3d.org

https://www.panda3d.org

https://github.com/panda3d/panda3d

Community Links

Panda3D Forums

GitHub issues

Discord server

StackOverflow

Reddit r/panda3d

Community Support

Panda3D Forums

GitHub issues

Discord community

StackOverflow

Carnegie Mellon University resources

Monetization

Commercial distribution

Subscription software

Ad integration via Python SDKs

VR/AR demo licensing

Research app funding

Future Roadmap

Better VR/AR support

Enhanced shader pipeline

Improved mobile deployment

Modern Python integration

Expanded community resources

When Not To Use

AAA-quality graphics games

Mobile-first development

Projects needing visual editor

Rapid asset store deployment

High-end VR/AR performance

Final Summary

Panda3D is a Python- and C++-powered 3D engine for games, simulations, and VR/AR apps.

Features a scene graph, task manager, physics, shaders, audio, and cross-platform deployment.

Ideal for rapid prototyping, educational, and research projects.

Open-source, flexible, and Python-friendly.

Best for developers wanting a full 3D engine with Python scripting control.

Faq

Is Panda3D free?

Yes - MIT licensed.

Does it support Python?

Yes - Python is the primary scripting language.

Can it be used for commercial games?

Yes - free for commercial use.

Does it support VR/AR?

Yes - with OpenVR/OpenXR integration.

Is it beginner-friendly?

Moderately - easier with Python experience.

Code Sample Descriptions

1

Panda3D Keyboard Movement Box

from direct.showbase.ShowBase import ShowBase
from panda3d.core import Point3

class MoveBox(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
        self.box = self.loader.loadModel('models/box')
        self.box.reparentTo(self.render)
        self.box.setPos(0, 10, 0)

        self.pos = Point3(0, 10, 0)
        self.accept('arrow_left', self.move, [-1])
        self.accept('arrow_right', self.move, [1])

    def move(self, x):
        self.pos.x += x
        self.box.setPos(self.pos)

app = MoveBox()
app.run()

Move a 3D box with arrow keys in Panda3D.

Let’s Try →
2

Panda3D Rotating Cube

from direct.showbase.ShowBase import ShowBase

class RotatingCube(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
        self.cube = self.loader.loadModel('models/box')
        self.cube.reparentTo(self.render)
        self.cube.setPos(0, 10, 0)
        self.taskMgr.add(self.rotate, 'rot')

    def rotate(self, task):
        self.cube.setH(self.cube.getH() + 1)
        return task.cont

app = RotatingCube()
app.run()

Simple rotation of a cube using Panda3D task manager.

Let’s Try →
3

Panda3D Change Color on Click

from direct.showbase.ShowBase import ShowBase
from panda3d.core import Vec4
import random

class ColorChanger(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
        self.obj = self.loader.loadModel('models/panda')
        self.obj.reparentTo(self.render)
        self.obj.setPos(0, 20, 0)

        self.accept('mouse1', self.change)

    def change(self):
        r = random.random()
        g = random.random()
        b = random.random()
        self.obj.setColor(Vec4(r, g, b, 1))

app = ColorChanger()
app.run()

Click to change a model's color.

Let’s Try →
4

Panda3D Simple Jumping Object

from direct.showbase.ShowBase import ShowBase

class Jumper(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
        self.cube = self.loader.loadModel('models/box')
        self.cube.reparentTo(self.render)
        self.cube.setPos(0, 15, 0)
        self.accept('space', self.jump)

    def jump(self):
        self.cube.setZ(self.cube.getZ() + 1)

app = Jumper()
app.run()

Press space to make a cube jump.

Let’s Try →
5

Panda3D Mouse-Following Sprite

from direct.showbase.ShowBase import ShowBase
from direct.gui.OnscreenImage import OnscreenImage

class MouseFollow(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
        self.cursor = OnscreenImage(image='cursor.png', pos=(0,0,0), scale=0.1)
        self.taskMgr.add(self.update, 'follow')

    def update(self, task):
        if self.mouseWatcherNode.hasMouse():
        x = self.mouseWatcherNode.getMouseX()
        y = self.mouseWatcherNode.getMouseY()
        self.cursor.setPos(x, 0, y)
        return task.cont

app = MouseFollow()
app.run()

A 2D sprite follows the mouse position.

Let’s Try →
6

Panda3D 3D Camera Orbit

from direct.showbase.ShowBase import ShowBase

class CameraOrbit(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
        self.model = self.loader.loadModel('models/box')
        self.model.reparentTo(self.render)
        self.model.setPos(0, 10, 0)

        self.orbit = 0
        self.taskMgr.add(self.rotateCam, 'orbit')

    def rotateCam(self, task):
        self.orbit += 0.5
        self.camera.setPos(20, 20, 10)
        self.camera.lookAt(self.model)
        return task.cont

app = CameraOrbit()
app.run()

Right drag the mouse to orbit around a model.

Let’s Try →
7

Panda3D Toggle Visibility

from direct.showbase.ShowBase import ShowBase

class ToggleObject(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
        self.model = self.loader.loadModel('models/panda')
        self.model.reparentTo(self.render)
        self.model.setPos(0, 15, 0)

        self.visible = True
        self.accept('v', self.toggle)

    def toggle(self):
        self.visible = not self.visible
        self.model.show() if self.visible else self.model.hide()

app = ToggleObject()
app.run()

Press V to toggle the model's visibility.

Let’s Try →
8

Panda3D Spin On Key Hold

from direct.showbase.ShowBase import ShowBase

class SpinOnHold(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
        self.obj = self.loader.loadModel('models/box')
        self.obj.reparentTo(self.render)
        self.obj.setPos(0, 15, 0)

        self.taskMgr.add(self.spin, 'spin')

    def spin(self, task):
        if self.mouseWatcherNode.is_button_down('arrow_left'):
        self.obj.setH(self.obj.getH() - 1)
        if self.mouseWatcherNode.is_button_down('arrow_right'):
        self.obj.setH(self.obj.getH() + 1)
        return task.cont

app = SpinOnHold()
app.run()

Hold left/right arrows to spin a model.

Let’s Try →
9

Panda3D Resize Model

from direct.showbase.ShowBase import ShowBase

class ScaleModel(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
        self.obj = self.loader.loadModel('models/box')
        self.obj.reparentTo(self.render)
        self.obj.setPos(0, 15, 0)
        self.scale = 1

        self.accept('+', self.change, [0.1])
        self.accept('-', self.change, [-0.1])

    def change(self, amt):
        self.scale += amt
        self.obj.setScale(self.scale)

app = ScaleModel()
app.run()

Press +/- to change model scale.

Let’s Try →
10

Panda3D Auto Forward Motion

from direct.showbase.ShowBase import ShowBase

class AutoMove(ShowBase):
    def __init__(self):
        ShowBase.__init__(self)
        self.obj = self.loader.loadModel('models/box')
        self.obj.reparentTo(self.render)
        self.obj.setPos(0, 5, 0)
        self.taskMgr.add(self.move, 'moveTask')

    def move(self, task):
        z = self.obj.getY()
        self.obj.setY(z + 0.05)
        return task.cont

app = AutoMove()
app.run()

Model automatically moves forward in 3D space.

Let’s Try →

Frequently Asked Questions about Panda3d

What is Panda3d?

Panda3D is an open-source, cross-platform game engine primarily for Python and C++ that supports 3D rendering, physics, audio, input, networking, and VR/AR applications. It is designed for both educational and commercial projects, with a focus on rapid prototyping and full-featured 3D game development.

What are the primary use cases for Panda3d?

3D games (desktop and mobile). Educational simulations and VR apps. Visualization tools and interactive media. Prototyping 3D environments. Research and AI simulation

What are the strengths of Panda3d?

Python-friendly, easy for rapid prototyping. Extensive 3D feature set. Open-source and free for commercial use. Highly customizable and flexible. Active community support and documentation

What are the limitations of Panda3d?

Not beginner-friendly for complex 3D projects. Mobile support is limited and requires workarounds. Editor tooling is minimal compared to Unity/Unreal. Performance tuning requires C++ knowledge. Fewer ready-made assets and marketplaces

How can I practice Panda3d typing speed?

CodeSpeedTest offers 10+ real Panda3d code examples for typing practice. You can measure your WPM, track accuracy, and improve your coding speed with guided exercises.

Learn Other Programming Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypherGremlinPartiqlHaskellElixirFsharpView all languages →
CodeSpeedTest

Improve your coding speed, code accuracy, and programming syntax WPM with practice sessions across 500+ programming languages.

Quick Links

HomeAboutFeaturesGetting StartedLanguages

Legal & Support

Pro ⚡ PricingContactPrivacy PolicyTerms of Service

Connect

CodeSpeedTest on GitHubCodeSpeedTest on TwitterEmail CodeSpeedTest

© 2026 CodeSpeedTest. All rights reserved.