tags:

views:

21

answers:

0

Hi guys. I got a problem and need you help. I'm about to implement a model slicing algorithm. The idea is simple. User selects with mouse the vector along wich the clipping pan have to move, and one time it fixed, he uses, let's sat track bar to move clipping pan along that vector, by slicing the chosen model. So the problem is to set minimum and maximum values of trackbar: what I do is: at the moment user defines the vector, I make a dotproduct(so projection) of that vector on every Axis (X,Y,Z), actually its absolute value. Pick up the bigest dotproduct from them, and pick up the relative dimension from the model's dimension box. For example: le't say the bigest dotproduct is on X axis, so the lowest movement value for cliping pan position is MinimumX of the model's bound, the MaximumX is highest movement value of cliping pan. But this doesn't seem to be working correctly.

Here is an image for better explanation: alt text

So what am I missed ?