Position coordinates different in Unity and Houdini.

   5682   3   0
User Avatar
Member
2 posts
Joined: Jan. 2017
Offline
I have made an asset that takes position coordinates from houdini and creates them as variables in an unity script. The only trouble is that they are incorrect(sometimes the X gets flipped, and Y/Z is totally off), but when I save the scene in houdini and check the coordinates, they are back to normal.

Is there some difference in how houdini treats coordinates when i open the scene by hand and when it is being calculated in the background. Should I scale the coordinates in some way or offset them? Has anyone noticed similar issues?
User Avatar
Member
571 posts
Joined: May 2017
Offline
Yes there is. Houdini uses right-handed coordinate system whereas Unity uses left-handed. You'll need to convert. For position, just negate the X. For rotation, negate the Y and Z.

Take a look at HoudiniAssetUtility::applyTransform to see how we're doing it.
User Avatar
Member
31 posts
Joined: Feb. 2017
Offline
Flipping X doesn't make any sense at all if you are working on things like terrains (converted to meshes, as native Unity terrain generation is still not usable). You would likely assume north is upwards in the Houdini top view. When importing into Unity, it ends up upside down, when using the Unity top view. The correct thing is to flip Z. The same problem occurs with the curve tool. It flips the X, so when used as input to my HDA, it does not match the coordinate system. Maybe for props etc., flipping the X would not cause many issues, but for world building, it really messes things up. Where can I change the Unity Engine v2 plugin to so that things are not rotated upside down in Unity? Also, rather than having to re-apply this patch each time I update the plugin, could you please make it configurable instead?
Edited by gyltefors - Sept. 10, 2018 06:53:40
User Avatar
Member
571 posts
Joined: May 2017
Offline
For now I've added an RFE to add a plugin setting to allow user to set the type of transform mapping from Houdini to unity.

I'll get back to you after I investigate the transform mapping discrepancy you are coming across.
  • Quick Links