Panda3D
  • Home
  • Features
  • Blog
  • Community
  • Manual
  • Get the SDK
Logo
1.9
Version
Python | C++
  • Introduction to Panda3D
    • Installing Panda3D in Windows
    • Installing Panda3D in Linux
    • General Preparation
    • Running your Program
    • A Panda3D Hello World Tutorial
      • Starting Panda3D
      • Loading the Grassy Scenery
      • Controlling the Camera
      • Loading and Animating the Panda Model
      • Using Intervals to move the Panda
      • Tutorial End
  • Programming with Panda3D
    • The Scene Graph
      • Scene Graph Manipulations
      • Common State Changes
      • Manipulating a Piece of a Model
      • Searching the Scene Graph
      • Instancing
    • The Configuration File
      • Configuring Panda3D
      • List of All Config Variables
      • Accessing Config Vars in a Program
    • Models and Actors
      • Loading Models
      • Loading Actors and Animations
      • Actor Animations
      • Multi-Part Actors
      • Attaching an Object to a Joint
      • Controlling a Joint Procedurally
      • Level of Detail
    • Render Attributes
      • List of All Attributes
      • Lighting
      • Materials
      • Depth Test and Depth Write
      • Fog
      • Alpha Testing
      • Color Write Masks
      • Antialiasing
      • Clip Planes
      • Tinting and Recoloring
      • Backface Culling and Frontface Culling
      • Occlusion Culling
        • Polygon Occluder Culling
        • Portal Culling
      • Light Ramps
      • Auxiliary Bitplane Control
      • Stencil Attribute
    • Texturing
      • Simple Texturing
      • Choosing a Texture Size
      • Texture Wrap Modes
      • Texture Filter Types
      • Simple Texture Replacement
      • Multitexture Introduction
      • Texture Modes
      • Texture Order
      • Texture Combine Modes
      • Texture Transforms
      • Multiple Texture Coordinate Sets
      • Automatic Texture Coordinates
      • Projected Textures
      • Simple Environment Mapping
      • 3-D Textures
      • Cube Maps
      • Environment Mapping with Cube Maps
      • Automatic Texture Animation
      • Playing MPG and AVI files
      • Multiview Textures
      • Transparency and Blending
      • Texture Management
      • Texture Compression
      • Creating New Textures from Scratch
    • Shaders
      • Shader Basics
      • List of Possible Cg Shader Inputs
      • List of GLSL Shader Inputs
      • Shaders and Coordinate Spaces
      • Known Shader Bugs and Limitations
      • The Shader Generator
      • Cg Shader Tutorial
        • Cg Tutorial Part 1
        • Cg Tutorial Part 2
        • Cg Tutorial Part 3
      • Compute Shaders
    • Camera Control
      • The Default Camera Driver
      • Lenses and Field of View
      • Orthographic Lenses
    • Sound
      • Loading and Playing Sounds and Music
      • Manipulating Sounds
      • Audio Managers
      • DSP Effects
      • 3D Audio
      • Multi-Channel
    • Intervals
      • Lerp Intervals
      • Function Intervals
      • Actor Intervals
      • Sound Intervals
      • Motion Path and Particle Intervals
      • Sequences and Parallels
      • Position, Rotation and Scale Intervals
      • Projectile Intervals
    • Tasks and Event Handling
      • Tasks
      • Task Chains
      • Event Handlers
      • Main Loop
    • Text and Image Rendering
      • Text Fonts
      • Text Node
      • OnscreenText
      • OnscreenImage
      • Embedded Text Properties
    • DirectGUI
      • DirectButton
      • DirectCheckButton
      • DirectRadioButton
      • DirectDialog
      • DirectEntry
      • DirectFrame
      • DirectLabel
      • DirectOptionMenu
      • DirectScrolledList
      • DirectWaitBar
      • DirectSlider
      • DirectScrollBar
      • DirectScrolledFrame
    • Render Effects
      • Billboard Effects
      • Compass Effects
    • Finite State Machines
      • FSM Introduction
      • Simple FSM Usage
      • FSM with input
      • Advanced FSM Tidbits
    • Terrain
      • The Heightfield Tesselator
      • Geometrical MipMapping
    • Advanced operations with internal structures
      • How Panda3D Stores Vertices and Geometry
        • GeomVertexData
        • GeomVertexFormat
        • GeomPrimitive
        • Geom
        • GeomNode
        • BoundingVolume
      • Procedurally Generating 3D Models
        • Defining your own GeomVertexFormat
        • Pre-defined vertex formats
        • Creating and filling a GeomVertexData
        • Creating the GeomPrimitive objects
        • Putting your new geometry in the scene graph
      • Other Vertex and Model Manipulation
        • Reading existing geometry data
        • Modifying existing geometry data
        • MeshDrawer
        • More about GeomVertexReader, GeomVertexWriter, and GeomVertexRewriter
        • Writing 3D Models out to Disk
    • Render-to-Texture and Image Postprocessing
      • Common Image Filters
      • Generalized Image Filters
      • Dynamic Cube Maps
      • Low-Level Render to Texture
    • Panda3D Rendering Process
      • Multithreaded Render Pipeline
      • Introducing Graphics Classes
      • The Graphics Pipe
      • Creating Windows and Buffers
      • Display Regions
      • Creating New MouseWatchers for Display Regions
      • Clearing Display Regions
      • The 2D Display Region
      • Stereo Display Regions
      • Multi-Pass Rendering
      • How to Control Render Order
      • Table of features supported per graphic renderer
    • Particle Effects
      • Using the Particle Panel
      • Loading Particle Systems
      • Particle Effect Basic Parameters
      • Particle Factories
      • Particle Emitters
      • Particle Renderers
    • Collision Detection
      • Collision Solids
      • Collision Handlers
      • Collision Entries
      • Collision Traversers
      • Collision Bitmasks
      • Rapidly-Moving Objects
      • Pusher Example
      • Event Example
      • Bitmask Example
      • Clicking on 3D Objects
    • Garbage Collection
      • Removing Custom Class Instances
    • Hardware support
      • Keyboard Support
      • Mouse Support
      • Joystick Support
    • Math Engine
      • Matrix Representation
    • Physics
      • Panda3D Physics Engine
        • Enabling physics on a node
        • Applying physics to a node
        • Types of forces
        • Notes and caveats
      • Using Bullet with Panda3D
        • Bullet Hello World
        • Bullet Debug Renderer
        • Bullet Collision Shapes
        • Bullet Collision Filtering
        • Bullet Continuous Collision Detection
        • Bullet Queries
        • Bullet Ghosts
        • Bullet Character Controller
        • Bullet Constraints
        • Bullet Vehicles
        • Bullet Softbodies
        • Bullet Softbody Rope
        • Bullet Softbody Patch
        • Bullet Softbody Triangles
        • Bullet Softbody Tetrahedron
        • Bullet Softbody Config
        • Bullet Config Options
        • Bullet FAQ
        • Bullet Samples
      • Using ODE with Panda3D
        • Worlds, Bodies and Masses
        • Simulating the Physics World
        • Attaching Bodies using Joints
        • Collision Detection with ODE
    • Motion Paths
    • Timing
      • The Global Clock
    • Networking
      • Datagram Protocol
        • Client-Server Connection
        • Transmitting Data
      • Downloading a File
      • Distributed Networking
    • Multifiles
      • Creating Multifiles
      • Patching
      • Loading resources from nonstandard sources
    • ShowBase
    • File Reading
    • Threading
    • Subclassing
    • Pathfinding using PandAI
      • Getting Started
      • Steering Behaviors
        • Seek
        • Flee
        • Pursue
        • Evade
        • Wander
        • Flock
        • Obstacle Avoidance
        • Path Follow
      • Pathfinding
        • Mesh Generation
        • Static Obstacles
        • Dynamic Obstacles
        • Uneven Terrain
      • Source Codes
    • Using C++
      • How to compile a C++ Panda3D program
        • How to compile a C++ Panda3D program on Linux
        • How to compile a C++ Panda3D program on macOS
      • The Window Framework
      • Texturing in C++
      • Reference Counting
  • Debugging
    • Log Messages
    • Inspection Utilities
    • The Python Debugger
    • Running Panda3D under the C++ Debugger
  • Distributing Panda3D Applications
    • Introduction to p3d files
      • Using packp3d
      • Referencing packages
      • Running p3d files
    • Distributing via the web
      • Embedding with an object element
      • Embedding with RunPanda3D
      • About certificates
        • Public key, private key
        • Self-signed certificates
        • HTTPS (Apache) certificates
        • Email certificates
      • Signing your p3d files
    • P3D file config settings
    • Distributing as a self-contained installer
    • The runtime Panda3D directory
    • The package system
      • Standard packages
      • Installing packages
      • More about referencing packages
      • Building and hosting your own packages
        • Using ppackage
        • The pdef syntax
        • Creating multiple packages
        • Hosting packages
        • SSL hosting
        • Building multiplatform packages
        • Building patches
    • Advanced scripting techniques
      • DetectPanda3D.js
      • Advanced object tags
      • Splash window tags
      • Plugin notify callbacks
      • AppRunner
        • The appRunner.main object
        • The appRunner.dom object
        • Reading the HTML tokens
        • Other appRunner members
      • P3D origin security
      • PackageInstaller
    • Third-party dependencies and license info
  • Performance Optimization
    • Basic Performance Diagnostics
    • Measuring Performance with PStats
    • The Rigid Body Combiner
    • Performance Issue: Too Many Meshes
    • Performance Issue: Too Many State Changes
    • Performance Issue: Too Many Text Updates
    • Performance Issue: Too Many Shader Instructions
    • Performance Issue: Excessive Fill
    • Performance Issue: Memory Full
    • Performance Issue: Python Calculation
    • Performance Issue: Failure to Garbage Collect
    • Performance Issue: Collision System Misuse
    • Performance Issue: Motherboard Integrated Video
    • Performance Issue: Too Many Polygons
    • Performance Issue: Miscellaneous
  • Panda3D Tools
    • The Scene Graph Browser
      • Enhanced Mouse Navigation
    • Interrogate
    • Pipeline Tips
    • Model Export
      • Converting from 3D Studio Max
      • Converting from Maya
      • Converting from Blender
      • Converting from Milkshape 3D
      • Converting from GMax
      • Converting from other Formats
      • Converting Egg to Bam
      • Parsing and Generating Egg Files
      • Egg Syntax
    • Previewing 3D Models in Pview
    • List of Panda3D Executables
  • More Panda3D Resources
    • FAQ
    • User Contributed Tutorials and Examples
    • Video Tutorials
    • Cheat Sheets
    • The IRC Channel
    • Sample Programs in the Distribution
      • Sample Programs: Asteroids
      • Sample Programs: Ball in Maze
      • Sample Programs: Boxing Robots
      • Sample Programs: Carousel
      • Sample Programs: Cartoon Shader
      • Sample Programs: Chessboard
      • Sample Programs: Disco Lights
      • Sample Programs: Distortion
      • Sample Programs: Fireflies
      • Sample Programs: Fractal Plants
      • Sample Programs: Gamepad
      • Sample Programs: Glow Filter
      • Sample Programs: Infinite Tunnel
      • Sample Programs: Looking and Gripping
      • Sample Programs: Media Player
      • Sample Programs: Motion Trails
      • Sample Programs: Mouse Modes
      • Sample Programs: Music Box
      • Sample Programs: Bump Mapping
      • Sample Programs: Particles
      • Sample Programs: Procedural Cube
      • Sample Programs: Teapot on TV
      • Sample Programs: Roaming Ralph
      • Sample Programs: Shadows
      • Sample Programs: Solar System
      • Sample Programs: Texture Swapping
  • API Reference
  • Glossary
  • »
  • More Panda3D Resources »
  • Sample Programs in the Distribution »
  • Sample Programs: Carousel
  • Edit on GitHub
Previous Next

Sample Programs: Carousel

To run a sample program, you need to install Panda3D. If you’re a Windows user, you’ll find the sample programs in your start menu. If you’re a Linux user, you’ll find the sample programs in /usr/share/panda3d.

Screenshots

../../../_images/screenshot-sample-programs-carousel.jpg

Explanation

This sample progam demonstrates some uses for intervals in panda to move objects in your panda world.

Intervals are built in Panda3D functions that will let you change an attribute over time. In this tutorial, the position and texture attributes of various objects will be altered over time to give life to a carousel. The most common intervals for doing simple movement of objects are the posInterval and hprInterval. These intervals will change the position/orientation of an object (or node) over a given time and given displacement/rotation, respectively. Another interval we will look at is the LerpFunc interval. LerpFunc will call a function and give it a linearly interpolated value range over a specified time range. This is how we will oscilate pandas via a sin wave and alternate textures over time. For more information on intervals, please refer to the intervals section of the online manual.

Back to the List of Sample Programs:

Sample Programs in the Distribution

Previous Next

© Copyright 2019 Carnegie Mellon University.

Built with Sphinx using a theme provided by Read the Docs.