Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/wavefront_obj/exporter/obj_export_mesh.cc
| Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void OBJMesh::set_world_axes_transform(const eIOAxis forward, const eIOAxis up) | void OBJMesh::set_world_axes_transform(const eIOAxis forward, const eIOAxis up) | ||||
| { | { | ||||
| float axes_transform[3][3]; | float axes_transform[3][3]; | ||||
| unit_m3(axes_transform); | unit_m3(axes_transform); | ||||
| /* +Y-forward and +Z-up are the default Blender axis settings. */ | /* +Y-forward and +Z-up are the default Blender axis settings. */ | ||||
| mat3_from_axis_conversion(forward, up, IO_AXIS_Y, IO_AXIS_Z, axes_transform); | mat3_from_axis_conversion(forward, up, IO_AXIS_Y, IO_AXIS_Z, axes_transform); | ||||
| mul_m4_m3m4(world_and_axes_transform_, axes_transform, export_object_eval_.obmat); | mul_m4_m3m4(world_and_axes_transform_, axes_transform, export_object_eval_.object_to_world); | ||||
| /* mul_m4_m3m4 does not transform last row of obmat, i.e. location data. */ | /* mul_m4_m3m4 does not transform last row of obmat, i.e. location data. */ | ||||
| mul_v3_m3v3(world_and_axes_transform_[3], axes_transform, export_object_eval_.obmat[3]); | mul_v3_m3v3( | ||||
| world_and_axes_transform_[3][3] = export_object_eval_.obmat[3][3]; | world_and_axes_transform_[3], axes_transform, export_object_eval_.object_to_world[3]); | ||||
| world_and_axes_transform_[3][3] = export_object_eval_.object_to_world[3][3]; | |||||
| /* Normals need inverse transpose of the regular matrix to handle non-uniform scale. */ | /* Normals need inverse transpose of the regular matrix to handle non-uniform scale. */ | ||||
| float normal_matrix[3][3]; | float normal_matrix[3][3]; | ||||
| copy_m3_m4(normal_matrix, world_and_axes_transform_); | copy_m3_m4(normal_matrix, world_and_axes_transform_); | ||||
| invert_m3_m3(world_and_axes_normal_transform_, normal_matrix); | invert_m3_m3(world_and_axes_normal_transform_, normal_matrix); | ||||
| transpose_m3(world_and_axes_normal_transform_); | transpose_m3(world_and_axes_normal_transform_); | ||||
| mirrored_transform_ = is_negative_m3(world_and_axes_normal_transform_); | mirrored_transform_ = is_negative_m3(world_and_axes_normal_transform_); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 380 Lines • Show Last 20 Lines | |||||