☑ Twisting a solid object

Hi,

What would be the best way to do twisting of an object? I’m creating a mechanical engineering lesson on torsion and would like to show a twisting effect of a solid cylinder.

-ikel

Twist in 3D editor.
In 3Ds max you can use modification twist

If you need to control your twisting, you can listen to Nickelback and animate your model. Afterwards, you can move between frames to change angle.

1 Like

I think the options are:

  • Create your mesh in Blender/3DS Max/Maya and skin it and then just rotate the bones along their direction to twist the mesh. Either do this with a keyframed animation created in the art tool, or by animating bones in script procedurally.
  • Write a custom shader to twist vertices of a mesh along a vector. You can do this by:
    • Writing vertex/fragment shaders from scratch. I can’t think of an Editor-based project that implements something like this but here’s an ‘Engine-only’ example which could be translated to the Editor very easily.
    • Writing a shader chunk to override the default vertex transform of the pc.StandardMaterial. This system isn’t officially API yet but there’s quite a few examples out there showing how the system works.

Unfortunately, you can’t do this with morph target animation (sometimes called ‘blend shapes’) - PlayCanvas doesn’t support this yet. But we do have an issue open if you’re interested to track this feature.

1 Like

I use Blender and able to do the same thing. I’m sorry, I wasn’t clear in the first place. I’s like to show a real time deformation.

Thanks for the 3DS Max suggestion.

Thanks! I’d go with the first option. Why didn’t I think of that! Very smart indeed.

1 Like

Any news on the " * Writing a shader chunk to override the default vertex transform of the pc.StandardMaterial. This system isn’t officially API yet but there’s quite a few examples out there showing how the system works."-part?