Animation-parse error, transform attributes.

Hi to all,

I am making progress with the parser/generator I’m writing, the egg-optchar issue I decided to drop by hard-coding the colors, materials and textures directly into the .egg file. Now two issues remain: setting group transform attributes, and storing animations.

For the animtions, I am using the exact method highlighted in the eggSyntax.txt file:


<Xfm$Anim_S$> xform {
          <Char*> order { sphrt }
          <Scalar> fps { 24 }
          <S$Anim> x { 0 0 10 10 20}
          <S$Anim> y { 0 0 0 0 0 }
          <S$Anim> z { 20 20 20 20 20}


But I get a parse error, here is the console output:

Error in 63_p3d_26.0.0.egg at line 337, column 15:
 <S$Anim> x { 0 0 10 10 20 }
parse error

When trying to view the model with pview. The model file, quite small (just 2 cubes) is attached.

Last is the setting of group attributes like position, scale and rotation. From the eggSyntax.txt file:

Anyone know a workaround to this? Basically, a model in the app [such as a cube for instance] is changed to a
group in the file; I would like the group to reflect the model’s position, hpr and scaling by assigning these attributes to the group that it would form in the .egg file. How can this be done?

63_p3d_26.0.0.egg (8.4 KB)

The syntax is this, I believe:

<S$Anim> x {
  <Scalar> fps { fps }
  <V> { 0 0 10 10 20 }

I’m not sure what you mean with your transform question. If you must give the vertices in local instead of global coordinates, you can replace the tag with an tag.

Thanks rdb, that solved the parse error regarding the animation question, I really appreciate it.

The transformation question is similar to this one; and at the end, ninth quotes the excerpt from the eggSyntax.txt file that I quoted:

[url]I want move something use <Transform> and <Matrix4>]

There doesn’t appear to be a definite answer. After I define the position of the vertices in the app, I store these positions/or parse the generated model for their position later on. Within the app, I change the pos, hpr and scale of the model itself. When writing the file, I write down the vertex data, which doesn’t reflect these transform changes. I use the { … } entry to reflect these changes. But I need the position of the vertices changed in world space, not local space, so that when the model is rendered, it is set to the exact pos, hpr and scale that it had before it was saved as an egg file. I hope that makes the question less vague.

I guess one way would be to just manipulate the joints “procedurally” and that would move a part of the actor placing it where I would like it to be. Affecting the transform values immediately after the file is loaded. That works.