over all those years I’m working with panda3d now, I’ve collected many snippets and code used in my projects. And now it’s time to share them all with the community.
Hello everyone,
as there is quite a lot of new stuff in the collection and to make it simpler to find this post if someone is searching for something specific that may be covered in this project, here is an updated and exhaustive list of all the samples that are currently readily available and well documented in the Collection.
The collection comes with all necessary models (aside of those shipped by default with Panda3D) so you should be able to open any of the scripts and just run them to see how they work and what they do.
Most if not all of the scripts should work with Panda3D 1.9.x and up.
Camera Systems
FPS
Fixed
Follow
Follow extended (even more extended version can be found in the extended character controller)
Top-down
Character Systems
Simple Character Controller Featuring:
[list][*]Basic walking
Basic 3rd person camera handler
PyGame Gamepad support
[/:m]
[]Extended Character Controller Featuring:
Extended Movements
[list][*]Walking
Running
Jumping
Wall runs
[/:m]
[]Smooth animation transitions[/:m]
[]Prevent from slipping off of slopes of arbitrary angles[/:m]
[]Extended 3rd person camera handler
Keep camera out of walls and out of the character
Move camera with mouse and/or keyboard
Center camera behind player
Lazy camera positioning
[/:m]
[]Using Panda3D internal Physic engine (support for bullet engine is planned)[/:m]
[]Simply and highly configurable[/:m]
[]Demo script showing it’s usage[/:m][/list:u][/:m][/list:u]
Core Features and basics
A rather complex main.py template to start a new Panda3D project from
[list][*]Contains various graphic enhancements
Game configuration loading and saving
Basic window setup
[/:m]
[]Asynchronous model loading snippet[/:m]
[]Selection box drawing[/:m]
[]Multifile extraction to temp directory[/:m]
[]Show a X/Y/Z Axis on the windows edge[/:m]
[]Using PRC files to simply store and load game configurations[/:m]
[]Snippets that show of Panda3D basics
Simple event handling
Simple (Finite State Machine) FSM usage
Load multifiles in Virtual File System
On Screen Debug (OSD)
Panda3D’s Tasks system
[/*:m][/list:u]
DirectGUI and other UI related things
Automatically scrolling Text Frame
Countdown
Drag and drop
Fade in/out
Loading screen
Simple Mouse Cursor changing with distiction between linux/unix and windows based systems
A simple HUD example
Automatic text writer pannel (for example for story elements in a game)
Input handling features
PyGame gamepad input
Basic mouse and keyboard input
Localisation
[]gettext example
[list]Contains how-to for creating gettext files
Shows how to select language manually as well as using the systems default language[/:m][/list:u] Level design features
Sky Cube around camera
Multimedia snippets
Very simple espeak snippet
Networking
Distributed Networking example with documentation
Physics
Bullet physics ball shooting example
Special effects (SFX)
Very basic shader loading and sample glsl shader
Specials snippets
Fullscreen toggle
Various graphic quality settings that can be set by Panda3D Like:
[list][*]Multisampling
Anistropic texture filtering
The automatic shader generator (Per pixel lighting and Shadow mapping)
Antialiasing
Screen resolution
[/:m]
[]Taking Screenshots[/:m]
[]Window title changing[/*:m][/list:u]
If you want to see something specific in this collection, I may be able to come up with a new snippet or example code. Other than that, every kind of contribution to it is still very welcome, especially reviewing and testing.
I downloaded most of the code manually, without using Bazaar.
Here is a link to my zip file with the code, for other users who may not want to use Bazaar. (Some of the folders are different, but I think I got all the important stuff.)
as of revision 67, some nice and big new features just landed in the collection. So I wanted to update you with them.
general
Added instructions in the readme.txt on how to generally use the samples
Character Systems
Added gamepad support (preview of Panda3D’s own gamepad handling, needs 1.10 input-overhaul build and currently only supports the Wii Remote further gamepad support will be added over time)
Added missing textures from the character
Some bugfixes and improvements
Multimedia snippets
Added 3D Audio sample
Added simple Video sample
Special effects (SFX)
Added simple but useful glsl shaders. Currently there are:
[list][*]simple per-vertex shader
normal mapping
lambert (flat and phong shaded)
half-lambert
velvet (rim-light)
gray scale
a snippet file with color models (currently WIP)
[/*:m][/list:u]
I’ll also add a download link to the current revision in the first post for anyone who may not want to or can’t use bazaar.
Is it possible to make this great collection code indexed by google (currently it not, AFAIK)? I believe this will give it best availability to people who search for example how to do something.
Added a snippet to show how window events can be handled
@elkav, I’m not aware of any way to specifically index this repository for google search, but I think it already ranks rather high if you search for panda3d code snippets for example (was the 4. entry on my last search). Aside of that, telling newcomers and generally all other panda3d users about this collection would probably help rise it’s visibility too. And if rdb or other maintainers would be ok with that, it could be added to this manual section: http://www.panda3d.org/manual/index.php/User_Contributed_Tutorials_and_Examples or somewhere below my already added books on http://www.panda3d.org/manual/index.php/More_Panda3D_Resources.
Hi sazearte, it definitely is possible to add such examples but probably will take some time untill I get to it. In the meantime you could already take them from the demomaster which you see in the linked video. It can be found over at Demomaster application framework with wxpython navigator Not sure how well it does work for recent versions of P3D though.
As soon as I get time I’ll take a look into vegetation, terrain and water as those are things I personally need too.
It’s not a bug, the AI folder is empty. I planned to fill it once, but haven’t got to it since. The terrain foliage is still planned, but I don’t know when I’ll get to it yet. As soon as it’s available, I’ll update this post.
You’re welcome. I’m not sure when I’ll get to it, usually I’ll add snippets as soon as I used them in my personal projects and as adding gras and other plants is part of something I want to add to my level, it may not be to far in the distant future.
As for the difficulty, there are also plenty of ways to add foliage to levels and even more possible dependencies for its implementation, so it depends. Like, should it be physical move with things like wind, water and other environmental things or move when the player runs through it as well as things like how should it be placed, should there be a texture map defining the amount and possition or should it be randomly scattered throughout the world and so on.
In general, nowdays you usually create a shader that implements a particle system to populate the floor with your defined foliage geometries. This isn’t all that hard if you know how to write glsl shaders in general. If this is out of your scope for now, you can also add static geometry to your level using your modelling application, blender for example has a few ways and good tutorials to spread objects randomly on the ground, which then could easily be exported to Panda3Ds model format, which in the end would probably be the most simple, but also performance wise worst way. But I don’t expect heavy frame drops if you don’t have particularely large levels.
Hope that information helps you for now. If you need anything in specific, you should open a new topic specific to adding foliage to your game or ask in the irc or discord channel or PM me.