Rotate a set of polygons around their respective centers

OK I have a static mesh model of a tree which consists of bark and leaves. I’d like the leaves to be aligned with camera at all times, but leave bark static. Good example of this is the foliage in World of Tanks.

I can align the polys with camera without any problems but the rotation uses the object’s location as the pivot. I’d like to use the polys’ respective centers for rotation. If anyone could supply a screenshot of such material or a good tut, I’d be a happy bunny!

Dare I bump ?

Hello davek -

If you have the setup working with Object Position, all you will need to do is add the Object Position to a Vector Parameter, let’s call it Leaf Location. Then Assign the Leaf Material to the Leaves as a Material Instance and in the instance adjust the Leaf Location value to correspond to the correct center point of the leaf planes.

This assumes that your bark is either masked to not use the WPO or that you have the bark and leaves on seperate Material Elements.

Thank You

Eric Ketchum

Thank you for your reply. What I meant is to rotate each leaf polygon around its own respective center. Leafs and bark already are separate material elements.

Hey it sounds like you want to look at the Content Examples Math Hallway Level and specifically a Material called, M_CameraVector_to_Object

Eric Ketchum

Thank you. I’ve had a look and it’s exactly what I needed. Top man.