Okay, I am a programmer, and I am working on some procedural generation, yada yada. I have a cube, which I will refer to as the "object". This cube's rotation is depicted via a grouping of two variables:
Vector3 direction; <-- THis variable is a vector of size 3, and named direction
float tilt; <-- This variable is a vector, of size 1, and named tilt
Direction specifies what way our object points. Tilt specifies the local rotation AROUND that direction. I will elaborate on this.
Direction specifies what way our object points, by assuming our cube is at the position (0,0,0), and then depicting a position. The object points to that position, from (0,0,0). For instance, if Direction were (0,1,1), the position would be one away from the object on both the Y and Z axis. In order for the object to point towards this position, the object would be rotated by 45 degrees around its X axis.
One further variable, tilt, is needed to specify the object's local rotation when pointing to its direction. In other words, imagine a 3D pyramid, pointing from (0,0,0) to (0, 1, 0). (we assume that the Y axis is up). The pyramid, can be rotated however it likes along its Y axis, and still be pointing to (0, 1, 0). Tilt specifies how it is rotated along its Y axis. Except, the Y axis is rotated, so if the pyramid were pointing to (0, 1, 0.5) (imagine a leaning pyramid), tilt would pretend that the pyramid is pointing straight up, and rotate the pyramid around that relative up.
Long story short, I want to know how to modify Direction, so as to rotate the object around a particular axis. For instance, if I want to rotate the object around the Y axis, how do I modify the X and Z axes to have the object rotated by a certain amount around the Y axis. I would like this to be as simple as possible -- The operation will be done many times in a row by the computer, and I do not want this math slowing my processing down.