vvvv / VL.StandardLibs

A collection of standard libraries for vvvv including VL.Stride, VL.Skia, VL.ImGui, msgpack.org[VL]
https://visualprogramming.net
GNU Lesser General Public License v3.0
35 stars 14 forks source link

OBJWriter should expose Transform In (e.g. for Coordinate System Conversion) #625

Closed mhusinsky closed 1 year ago

mhusinsky commented 1 year ago

Is your feature request related to a problem? Please describe. The OBJ writer assumes a certain type of output coordinate system that does not necessarily comply with the coordinate system of the target application where the OBJ will be used (even VVVV would display the OBJ differently).

Describe the solution you'd like Exposing a transform input for the CoordinateSystemConversion on the OBJWriter node would allow for setting the coordinate system yourself, instead of the node's internal assumption. grafik

Describe alternatives you've considered An additional Transform input pin. Unconnected would output the model as it is represented in Stride. With (any) transform connected, the target output would take the respective orientation.

Additional note It should be easy to implement and I'd be happy to create a PR if you agree with this idea.

mhusinsky commented 1 year ago

i just noticed that the transform is not applied at all currently (but probably should for flexibility reasons - see post above).

however, there is a bug with setting the y/z components, which are flipped (due to imprecise Pin alignment in the AppendV3 node).

grafik

joreg commented 1 year ago

thanks for that report. i've fixed the zy swap which revealed another issue: the face-winding was off, which could be seen when loading an .obj that was saved with ObjWriter. it is not entirely clear to me why this is the case since both stride(dx11) and obj should have counter-clockwise ordering of faces.

so if you encounter normals/face-winding issues, please reopen.

also exposed the Transform input so you can do custom CoordinateSystem conversion on export.