Skip to content

Commit

Permalink
VOXELFORMAT: FBX: we have to transform the vertices from source to ta…
Browse files Browse the repository at this point in the history
…rget coordinate system

with setting the target_axes option to ufbx_axes_right_handed_y_up we only convert
the transforms, but not the vertices itself - and we use the vertices without
transforms to voxelize the mesh

see issue #447
  • Loading branch information
mgerhardy committed Apr 14, 2024
1 parent 3a5b729 commit 59eb4a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/voxelformat/private/mesh/FBXFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ int FBXFormat::addMeshNode(const ufbx_scene *scene, const ufbx_node *node, const
} else if (material->pbr.base_color.value_components == 4) {
baseColorRGBA = priv::_ufbx_to_vec4(material->pbr.base_color.value_vec4);
}
if (material->features.ior.enabled) {
// TODO: rendering features for e.g. magicavoxel
}
}
if (material->features.ior.enabled) {
// TODO: rendering features for e.g. magicavoxel
}
const core::String &materialName = priv::_ufbx_to_string(material->name);
auto textureIter = textures.find(materialName);
Expand Down Expand Up @@ -374,7 +374,7 @@ int FBXFormat::addMeshNode(const ufbx_scene *scene, const ufbx_node *node, const
}
const ufbx_vec2 &uv =
mesh->vertex_uv.exists ? ufbx_get_vertex_vec2(&mesh->vertex_uv, ix) : defaultUV;
tri.vertices[ti] = priv::_ufbx_to_vec3(pos) * scale;
tri.vertices[ti] = priv::_ufbx_to_vec3(pos) * scale; // TODO: transform here - see issue https://github.com/vengi-voxel/vengi/issues/227
tri.uv[ti] = priv::_ufbx_to_vec2(uv);
}
tri.texture = texture;
Expand Down

0 comments on commit 59eb4a6

Please sign in to comment.