speckleworks / SpeckleUnity

Stream live 3D data into Unity with the open data platform for BIM - Speckle!
https://speckleworks.github.io/SpeckleUnity/
MIT License
14 stars 5 forks source link

Stream objects all have their pivot at world origin #60

Closed pablothedolphin closed 4 years ago

pablothedolphin commented 4 years ago

This throws off things like transparency culling and also limits the usecases of objects once received.

tsvilans commented 4 years ago

Another good reason to implement the transform property on Speckle objects! @didimitrie

pablothedolphin commented 4 years ago

@tsvilans has this been debated for a while? I was just going to create a new transform at the centre of the vertices of each mesh, subtract that offset from each vertex to realign them and call it a job done.

Though I would want to hold off on my changes if this is going to be supported naively by speckle...

tsvilans commented 4 years ago

@pablothedolphin Sometimes a transform property appears in a Speckle object schema, but the other clients haven't really integrated it, since Rhino et al. don't have a separation between model and model data. The Blender client does check for this, and uses a 4x4 transform matrix if it is found, so it considers the object data as being in local / object space...

Maybe with enough pushing we can get this better supported ;)

I'd say, for now, you can re-centre the object data upon import? I guess it needs to be decided whether or not the incoming Speckle data is in local or global space...

cwmorse commented 4 years ago

As someone who works mostly with Rhino, I think the re-centre plan makes sense since Rhino geometry won't have a transform.

But also I could see situations where I don't want it to add transforms and would rather keep the data as close to parity with Rhino as possible. So if this could be an optional toggle, that would be ideal for me.

pablothedolphin commented 4 years ago

Thanks for the feedback @cwmorse ! Toggling the feature should be no problem I'll add that in today!