I hereby claim:
- I am rdb on github.
- I am rdb (https://keybase.io/rdb) on keybase.
- I have a public key whose fingerprint is 2C05 2186 A18D E379 EEC5 C534 92F0 6704 80AD 5260
To claim this, I am signing this object:
// Recalculate the color. | |
PN_stdfloat mm = 1000.0 / temperature; | |
PN_stdfloat mm2 = mm * mm; | |
PN_stdfloat mm3 = mm2 * mm; | |
PN_stdfloat x, y; | |
if (temperature < 4000) { | |
x = -0.2661239 * mm3 - 0.2343580 * mm2 + 0.8776956 * mm + 0.179910; | |
} else { | |
x = -3.0258469 * mm3 + 2.1070379 * mm2 + 0.2226347 * mm + 0.240390; |
""" | |
This example shows how to use the new Python factory function in the BamReader | |
in order to add a custom hook that is called when the BamReader encounters an | |
object of a certain type. | |
You can also use this to add a custom hook whenever the bam reader loads an | |
existing type, for example if you want to do some post-process task on every | |
GeomNode or Material loaded from the .bam file. | |
""" |
from panda3d.core import * | |
#load_prc_file_data("", "gl-version 3 3") | |
from array import array | |
# Create two silly triangles. | |
data = array('f', [ | |
0, 4, 0, | |
1, 4, 1, | |
0, 4, 1, |
from panda3d import core, direct, physics, fx, egg | |
import sys | |
if len(sys.argv) > 1: | |
classname = sys.argv[1] | |
else: | |
classname = input("class> ") | |
for module in [core, direct, physics, fx, egg]: | |
if hasattr(module, classname): |
I hereby claim:
To claim this, I am signing this object:
# When importing a Panda class, importing everything into the namespace is considered bad style: | |
from panda3d.bullet import * | |
# Instead, it is better to enumerate each class specifically: | |
from panda3d.bullet import BulletWorld, BulletDebugNode | |
# This gets quite tedious to maintain, so it is easier to do: | |
from panda3d import bullet | |
w = bullet.BulletWorld() |
from panda3d.core import * | |
from direct.showbase.ShowBase import ShowBase | |
shader = Shader.load(Shader.SL_GLSL, "silh.vert", "silh.frag", "silh.geom") | |
base = ShowBase() | |
model = base.loader.loadModel("teapot.egg") | |
model.reparentTo(base.render) | |
model.setShader(shader) | |
model.setRenderModeThickness(2.0) |
from direct.showbase.ShowBase import ShowBase | |
from panda3d.core import * | |
# Use this import to make sure you support the VFS | |
from direct.stdpy.file import open | |
class SmurfLoader: | |
# Human-readable name of the format | |
name = "Smurf" |
diff --git a/panda/src/gobj/geomPrimitive.cxx b/panda/src/gobj/geomPrimitive.cxx | |
index afa406e921..73aaf77c40 100644 | |
--- a/panda/src/gobj/geomPrimitive.cxx | |
+++ b/panda/src/gobj/geomPrimitive.cxx | |
@@ -1612,7 +1612,7 @@ calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point, | |
// Find the first non-NaN vertex. | |
while (!found_any && i < cdata->_num_vertices) { | |
reader.set_row(cdata->_first_vertex + i); | |
- LPoint3 first_vertex = mat.xform_point(reader.get_data3()); | |
+ LPoint3 first_vertex = mat.xform_point_general(reader.get_data3()); |
This is the technical documentation for the .bam format. This is generally not useful except for developers who insist on writing their own tools to manipulate .bam files without using the Panda APIs.
== Bam versions ==
The .bam format has a major.minor version scheme. The format is designed to be backward compatible, so that .bam files created with older versions of Panda3D will generally work with newer versions of Panda3D, although occasionally compatibility has been broken due to major changes in the Panda3D structures.