triplex icon indicating copy to clipboard operation
triplex copied to clipboard

Prop tags for declaring scene transformable props

Open itsdouges opened this issue 2 years ago • 3 comments

If a custom component defines position / rotation / scale shorthand's triplex should handle it by being transformable in scene but limited the transforms to the appropriate axis.

Props:

  • position-x/y/z
  • scale-x/y/z
  • rotation-x/y/z

Let's discuss.

itsdouges avatar Jun 27 '23 08:06 itsdouges

I think the above, and the already built in array format, are the only plausible defaults because they are built into R3F. Otherwise, I think you would need UI hints to guide Triplex to attaching a gizmo to a given set of props.

krispya avatar Jun 27 '23 23:06 krispya

Thanks, I agree.

I think you would need UI hints to guide Triplex to attaching a gizmo to a given set of props.

What would that look like?

itsdouges avatar Jun 28 '23 12:06 itsdouges

I suppose some kind of data format in a comment.

// @triplex-gizmo-position: { x: posX, y: posY }
const Enemy = ({ posX, posY }) => (
  // <mesh> ...
)

krispya avatar Jun 28 '23 16:06 krispya