I’m encoding a VR software that enables the consumer to level the controller to an object (there’s a “laser” extends from the entrance of the controller and is used within the success exams) and alter their place, orientation and scale. When it factors to an object, the set off permits the consumer to tug the thing across the room, to the left or to the best within the joystick causes the thing to revolve round its and native axis, and up or down on the joystick adjustment scale (across the level of the thing the place the laser hits).
In isolation, I could make all operations work correctly. Nonetheless, when I attempt to mix all of them or have a number of consecutive operations, issues go flawed. For instance, in the event you scale the thing, then it doesn’t monitor with the laser by translating. Or when translating the thing, it not revolves across the middle of the thing or scale across the level that hits the laser.
My present strategy is that this:
On every replace:
if first replace:
Save the objects present rework
Save the hit location (the place on the thing the laser hit)
Create a rework for the present operation (i.e. if scaling, translate the hit level to the origin, alter the size, after which translate again to the hit level)
Multiply the earlier rework by the brand new rework, and apply it to the thing
I really feel that I’m essentially misunderstanding methods to apply the transformations. Is that this the right strategy? Or do I would like to trace translations/rotations/separate scales and mix them on the finish?