arcball question again!

i have a correct working arcball, but now i want to constrain the movement to a certain axis, like the rotate tool in max/maya

paul

I coded my own implementation of arcball a few years ago, which includes axis constrain. Check the (processing) source here:

http://www.chronotext.org/bits/030/arcball_1.pde

Points to focus-on:

  1. axisSet = new Vec3[] {new Vec3(1.0f, 0.0f, 0.0f), new Vec3(0.0f, 1.0f, 0.0f), new Vec3(0.0f, 0.0f, 1.0f)};
    For instance, the X, Y and Z axes (could be anything else…)

  2. the end of the mouse_to_sphere(float x, float y) method

  3. the constrain_vector(Vec3 vector, Vec3 axis) method

Hope it helps…