41
  Action commands
  Shear
 
1. Shearing objects
Another way of transforming objects is with the shear command. Wiith scale, you can change the sizes of the axises of the object, whereas with shear, you can put 1 object axis (or 2 of the axises) into another gradient. The result is that the model is oblique and with a perspective distortion and sometimes even deformed.
p2cube0200.rwx
create shear 1
create shear 1 0 0 0 0 0
In this example (see picture) , the object has been put into an angle of ±45 degrees on the x-axis of the object. In fact, the entire command consists of 6 numbers, but in this case, the 5 numbers that follow can be dropped/omitted in the action command.
create shear 5
the maximum number for the shear command is 5, but it's better to use maximum 1 , because otherwise the object is distorted outside the bounding box , and it's often difficult to select the objects again when they are sheared too much.
create shear 5 5 0
when you apply this, the 3d-model will be flattened into a 2d-model

 

 

p2cube0200.rwx
create shear 0.25 0 0
create shear -0.25 0 0
In this example (see picture2) , the object has been distorted on the x-axis by 0.25 (= 25 percent of the width of the object) . If you add a negative value, then the distortion will be into the other direction. If you turn around the object by 180 degrees, then you will see that both objects have the same shape.
p2cube0200.rwx
create shear 1 0 0 (= or also : create shear 1 )
create shear 0 0 1
create shear 0 1 0
In this example (see picture3) , 2 objects have been distorted, one on the y-axis by 1 (= 100 percent of the height of the object) and one on the z-as by 1 (= 100 percent of the depth/length of the object).
If you make 3 cubes with the 3 examples mentioned here, then you will see that their shape is identical, when you start to rotate the objects.
p2cube0200.rwx
create shear 0 0 0 1 0 0
create shear 0 0 0 0 1 0
create shear 0 0 0 0 0 1
Where already told that the entire shear command consisted of 6 numbers : the 3 last numbers also distort the model on the x- y- and z- axis but into the opposite direction of the axis.
create shear 0 0 1 0 0 0 ---and: ----- create shear 0 0 0 1 0 0
If you make these 2 distorted cubes with these commands, then you will see that their shape is identical , when you rotate the objects.
create shear 0 1 0 0 1 0
Here a dstortion of both directions of the y-axises which results in a larger object with 45 percent rotation.
2. Banisters for stairs
 
The shear command is often used for banisters, certainly if you don't have any models, you will often have to use a lot of objects for it, except if you use the shear command.
rm-rail5.rwx
create shear 0 0 -0.5
We see that the shear for the object does not work like it should, because all parts of the model are sheared differently. The solution is to search for almost identical parts And we shear them seperately. We have found in the texture yard of the world uberpath : "at_rail1" and also the mask for it :" ab_rail1m".
pictwll1.rwx
create texture at_rail1 mask=ab_rail1m , scale 1.5 0.8 0.8 , shear 0 0 -0.5
And we found rm-peak5 in the object yard of uberpath , and scale the object :
rm-peak5.rwx
create scale 0.6 0.3 0.5 , shear 0 0 -0.5
The shear command has also been used for several parts of the staircase in the Awexpo zone. By using the prim objects and by scaling and shearing , using a texture and a color tint, you can create almost anything.
w2crv_0500f.rwx
create texture bed6,color tint CDC2A4,scale .7 .25 .3,shear 0 0 -1.8
w3crv_1000e.rwx
create texture bed6,scale 4.05 1 .8,shear 0 0 -.5 -.025 .25
w2crv_0500f.rwx
create texture bed6,color tint CDC2A4,scale 1.4 .5,shear 0 0 0 -1
3. Shearing land pieces
The shear command is often used for shearing land pieces. In building areas where you have no terrain rights, you can still make a nice landscape with hills by using sheared land piece objects. We use the pictwlkh objects, which are 10x10meters in size.
pictwlkh.rwx
create texture boden , shear 0 0 .2
In this case the terrain in raised on 1 side by 20 percent (=2 meters). Now we build a second pictwlkh next to it, you need to press 4 times upon the + -key in order to be at the level of 2 meters.(=4x50cm) And we can start to shear this next pictwlk-object too :
create texture boden,shear 0 0 .4
Now this land piece is more steep , and raises on 1 side by 40 percent (= 4 meters). Now we build again a new land piece and press 8 times the +-key (=8x50cm) , so that this landpiece matches with the previous landpiece.
create texture boden,shear 0 0 0.6
And we can even go more steep ...
creating a hill or mountain...
Now we have come at the moment, where we are adding landpieces where the terrain also goes up at the left or right side , this means we have to shear upon 2 axises , and for this, we follow the golden rule : "In the complete shear command, which contains 6 numbers , only the 3rd and 4th numbers need to be adjusted. ( 0 0 # # 0 0)". This means it's the 4th number that we need to add now. Let's look at a few examples ....
pictwlkh.rwx
create texture boden,shear 0 0 0.4 0.2 0 0 (->you can omit the last 2 numbers)
In this case we add a landpiece which still goes up by 60 percent on the Z-axis, but now it goes also up on the X-axis by 20 percent. We bring the new piece to the right level.
create texture boden,shear 0 0 0.6 0.4 (->the 2 last numbers are omitted)
We still add more pieces which are more steep and now we can create an entire hill.
In Happy Valley, all hills are made with shear, and only numbers 3 and 4 have been used. In the AWExpo area however, they have used number 5 as well , but this is not required. Don't make it too complicated for yourself and follow the golden rule.
Using other (and smaller) landpieces ....
 
pictwll4.rwx / pictwll3.rwx / pictwll3.rwx
create texture boden , shear 0.2 0 0
create texture terrain0 ,shear 0.2 0 0 0 0.2 0 (->you can omit the last number)
First of all, these objects are "wall'-objects and not "walk"-objects. When using them, you need to rotate them by 90 degrees in order to use them as terrain objects. The consequence for landscaping is, that other axises are used, here you have another golden rule : here it's the 1st and the 5th number of the command .
The pictwll4-ojbect is 5x5meters in size -> for levelling, press 2 times upon the +key. (=2x50cm), so this is still easy to use .
The pictwll3-object is 4x4meters in size -> for levelling: press 1 time upon the +key and then 6 times with the shift (=50cm+(6x5cm) = total of 80cm )
The pictwll2-object is 2x2 meters is size -> for levelling press 8 times upon the shift and +key (= 8x5cm)= total of 40cm).
As you can see, if you use smaller objects ,but then the levelling will be "precision building", and will be a bit more complicated...
Matching all landpieces when having different increases ...
When landscaping, you will also have areas where the terrain goes up again. The problem is that you cannot change the shear command, because if you change the number to 0.2 instead of 0.4, then the land piece will not match with the previous land piece, which has a shear of 0.4. That's why you need to put 2 landpieces on this position : one where the land goes up with 0.4 and one where the land goes up with 0.2. In the example upon the picture, in order to make this clear , there has been used another terrain texture for this.
pictwlkh.rwx
create texture boden,shear 0 0 0.6 0.2 (the last 2 numbers are omitted)
create texture terrain14 ,shear 0 0 0.2
You see that the pictwll-objects with the grass-texture are slicing with the pictwll-objects with the rock-texture.
4. Animations with shear
 
Just like with the scale command, you can make similar animations with shear.
 
Read more about the shear command on the AW Wiki pages :
http://wiki.activeworlds.com/index.php?title=Shear
and in AWSschool 19N 140W