0

I want to use blender to create my 3d models and then import them into my opengl project. I have a class named “Mesh” that also contains a list of sub Meshes.

In blender, I create three box meshes literally stacked on top of each other. The first is called “body” the next “neck” and finally “head.” In blender I simply went to "Add" then "Cube" and then moved the cube only vertically in the Y direction.

When I export the file as a x3d these are the results I get in the file... just as expected.

<Transform DEF="body_TRANSFORM"
                   translation="0.000000 0.000000 0.000000"
                  ...>
<Transform DEF="neck_TRANSFORM"
                   translation="0.000000 2.247268 0.000000"
                  ...>
<Transform DEF="head_TRANSFORM"
                   translation="0.000000 4.824310 0.000000"
                   ...>

Now for my opengl project I want the main mesh to be the body, a submesh the neck and then a submesh of the neck, I want to be the head. So in blender, in the scene tree view, I drag the head into the neck and the neck into the body so I have this...

body     
|_______Neck     
           |_________Head

As a result, I expect the translation in the y dimension to change and become relative. Instead this is what I get...

<Transform DEF="body_TRANSFORM"
                   translation="0.000000 0.000000 0.000000"
                   ...>
<Transform DEF="neck_TRANSFORM"
                       translation="0.000000 0.000000 2.247268"
                      ...>
<Transform DEF="head_TRANSFORM"
                           translation="0.000000 0.000000 2.577042"
                           ...>

As you can see, instead of being in the Y dimension, blender exported it and put the changes in the Z dimension.

Can anyone help me understand what I am doing wrong? These are the results I anticipated...

<Transform DEF="body_TRANSFORM"
                   translation="0.000000 0.000000 0.000000"
                   ...>
<Transform DEF="neck_TRANSFORM"
                       translation="0.000000 2.247268 0.000000"
                       ...>
<Transform DEF="head_TRANSFORM"
                           translation="0.000000 2.577042 0.000000"
                           ...>

I will also take any other ideas how to get models into my project, so long as I can create the submeshes relationship in blender.

4

0 回答 0