Wednesday, December 25, 2013

How to tilt container slots

By changing the orientation of their vectors, container slots can hold an object at a tilt.

You only have to change the rotation values of the slots to proper ones in s3pe.



For example, I cloned an end table and changed the vector parameters of one container slot as following:





I copied these ‘Rot’ values from a slot in an easel.   The object placed on this slot will slightly lean backward (z- direction).

I also changed the position of the slot at this time.   If you want to move the positions of container slot, you have to edit their corresponding ‘Pos’ values in both RSLT and _RIG with s3pe.  You need not change bone name / hash nor slot name / hash.



I edited all nine slots in this way, and put it into game.



The objects on these slots were tilted as intended.


How to determine vector orientation


If you want to rotate a slot only in one direction, it’s easy to determine the vector parameter.

The magnitude of the vector has to be 1 in x, y, and z components. If they are not 1, the shape of the object placed on the slot will deform. Of course if you want to deform or resize the object, you can adjust its shape by changing the magnitude of each components.

For example, in the case where you want to tilt a slot so as to lean forward by 15 degrees.



First get the values “sin (15 degrees)” and “cos (15 degrees)”. Don’t worry about trig function.  Search on google with query terms “sin 15 degrees” or “cos 15 degrees”.  The answer will be “0.2588190451” and “0.96592582628”.

Input each Rot value in RSLT.







2 comments:

  1. I will make a lighting with this, I'm in the creative mood, so I will try this, if it does not work then I will make it in the mesh :)
    Thank you Pocci!

    ReplyDelete
    Replies
    1. Oh you're in the creative mood? It's exciting! :D
      Many lighting objects I saw don't have RSLT. So, if you want to add slots to a lamp, you need to add RSLT resource to it first. Please let me know if you encounter any problem on that project.

      Delete