Open PeterBowman opened 3 years ago
As a workaround, I resorted to requesting individual color properties, i.e.:
auto r = file.request_properties_from_element("vertex", {"red"});
auto g = file.request_properties_from_element("vertex", {"green"});
auto b = file.request_properties_from_element("vertex", {"blue"});
// now, memcpy those values individually into the `float3` structure
Let's assume I have the following dummy .ply file:
Please note the order of
blue
,green
andred
properties.Then, I want to load this information into a pre-made structure an external library imposes on me, the peculiarity being that it represents color values encoded in memory in a specific order. You can read this issue in a twofold manner: either order is BGR in the .ply file and RGB in my custom structure, or order is RGB in the .ply and BGR in said structure.
In other words, the order of properties in the .ply file differs from the order of properties as represented in memory by the structure, let's name it
float3
in the example below. My attempt to circumvent this scenario is to request said properties in the order expected byfloat3
:I'd expect tinyply to parse the .ply in the order specified in
request_properties_from_element
, which is what I ultimately want tomemcpy
into myfloat3
structure. However, tinyply reads actualblue
values asred
and viceversa, simply following the order of properties in the .ply file.