DavidBrainard / RenderToolbox3

Matlab toolbox for managing graphics rendering for psychophysics
MIT License
11 stars 4 forks source link

Lack of 4x4 transformation matrix support in ConvertNode.m #39

Closed npcottaris closed 10 years ago

npcottaris commented 10 years ago

ConvertNode.m currently fails to parse certain Collada files because it is searching for explicit definitions of the translation, rotation, and scaling factors for the various objects, whereas Collada files generated by Blender v 2.68 include composite 4x4 transforms that describe the 3 individual transforms. A work-around this issue is to export using the following Python command from Blender's console: bpy.ops.wm.collada_export(filepath=fileName, export_transformation_type_selection='transrotloc');

Note however, that the exporter will not strictly follow this option setting, but will rather take it as a hint to use the option if ever possible. This is so because some of the exported data types have specific rules about how the transformation matrix has to be exported.

benjamin-heasly commented 10 years ago

I agree ConvertNode should support 4x4 transformations.

Note that ConvertNode is part of the Collada to PBRT converter. So this issue should only affect PBRT renderings.

Another workaround would be to use Blender version 2.63, which exports Collada with a different style of transformations.

benjamin-heasly commented 10 years ago

While working on this fix, I noticed that the PBRT plugin's ConvertNode function hard-codes the order in which transformations are applied: translations, rotations, scalings. But it should just take transformations in the order they occur in the Collada document.

I'm adding this change to the scope of this issue.

benjamin-heasly commented 10 years ago

1880336b68abf407535c7195a73bbc631440b23a contains this change. I tested it with a few scenes.