Modelcache and coordinate-system

Hello,
here is a little stumbling block (or feature :slight_smile: I experienced today. But first the symptoms:

I have a simple blender model which is basically a spike pointing in +z direction. I get two different results for the following two procedures:

(1)

  • export model using chicken (.egg is z-up)
  • view the model with pview
  • load the model in a small script that sets the default coordinate system to y-up.
    ==> the spike points in +z direction

(2)

  • export model using chicken (.egg is z-up)
  • load the model in a small script that sets the default coordinate system to y-up.
    ==> the spike points in +y direction

For the explanation, or what I think the explanation is:

  • When loading the .egg file the first time Panda3D makes an entry in the modelcache, on disk. If pview loads the model first it is not modified, since pview uses z-up as default coordinate system.

  • If my script loads the model the first time it gets somehow transformed to y-up (the model is still z-up, I checked this from the modelcache file, just the coordinates are swapped for each vertex).

  • The next time the .egg file is loaded Panda3D uses the model cache, no matter what the default coordinate system is.

I assume this transformation is a feature, but can it be disabled, perhaps by using a config variable? Maybe it would be a nice feature for the Chicken exporter to let users choose what coordinate system they want to export for (just changing the first line of thegenerated .egg file, and not transforming any vertex cooridnates).

enn0x

My suggestion would be, if you are changing the default coordinate system for your application, you should also change the model-cache directory at the same time, since the coordinate system of the model gets baked into the model-cache directory at the time each model is loaded.

David