- Home /

# Shear transformation using GameObject transformations

Is it possible to create shear transformation (for 2 or at least 1 axis) using cascade of GameObject transform operations?

I know that t$$anonymous$$s is possible to do using Mesh API or proper shader, but I would like to know if the same effect can be ac$$anonymous$$eved using only plain GameObjects and some scripting instead.

**Answer** by Trejkaz
·
Jun 20, 2018 at 09:35 AM

It can be done. Example:

Outermost game object: Rotation X=22.5, Y=0, Z=0

Next game object in: Scale X=1, Y=0.3826834, Z=0.9238795

Next game object in: Rotation X=-45, Y=0, Z=0

Next game object in: Scale X=1, Y=2, Z=1.414214

Standard unit cube inside that.

Produces a 45 degree shear on X:

The general case:

Rotate by X=theta/2 counter-clockwise

Scale by Y=sin(theta/2), Z=cos(theta/2)

Rotate by X=45 degrees clockwise

Scale by Y=sqrt(2)/sin(theta), Z=sqrt(2).

You can probably reduce that to two game objects but I left it as 4 to illustrate how many transformations are being done.

I know this is old, but I really don't see how you got to these numbers with these formulas.

A simpler method can be found here: https://twitter.com/MajorMcDoom/status/1231447166092054528 Simply nest the object to shear in another, rotate the outer one way, rotate the inner another way, scale the outer object, boom!

**Answer** by steakpinball
·
May 06, 2015 at 05:56 PM

No. Transforms can only translate, rotate, and scale. Combining those operations never produces shear. You will have to use somet$$anonymous$$ng else to produce shear.

Or you could use game objects and rotations and scaling. Example in my alternative answer.

This answer is only true if you only use a uniform scale. If you have a non-uniform scale it can produce a shear

### Your answer

### Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

### Follow this Question

### Related Questions

How to keep a Gameobject in the same position after a transform.Rotate? 2 Answers

How can i get ONLY the childrens of a GameOnbject with GetComponentsInChildren method? 5 Answers

Affine transformations to Object 3 Answers

How would you fake air resistance? (c#) 2 Answers

Transforming a GameObject with an unattached script 1 Answer