dialog:: made dialog matrix more intuitive for anims::movement_angle

This commit is contained in:
Zeno Rogue 2023-08-14 10:52:17 +02:00
parent 9ab2b2bbd8
commit ea193d23b1
2 changed files with 9 additions and 7 deletions

View File

@ -591,7 +591,7 @@ EX namespace dialog {
vector<hyperpoint> pts;
for(int a=0; a<dim; a++) {
hyperpoint h = C0; h[a] = r;
pts.push_back(rot_inverse(T.get()) * h);
pts.push_back(T.get() * h);
}
flat_model_enabler fme;
@ -612,7 +612,7 @@ EX namespace dialog {
queuecurve(V, cols[a], 0, PPR::LINE);
}
if(dim == 3) for(int a=0; a<dim; a++) {
auto pt = pts[a]; ld val = pt[2] * vid.fsize / r / 5;
auto pt = pts[a]; ld val = -pt[2] * vid.fsize / r / 5;
curvepoint(hyperpoint(pt[0], pt[1]+val, 1, 1));
curvepoint(hyperpoint(pt[0]-val, pt[1]-val*sqrt(3)/2, 1, 1));
curvepoint(hyperpoint(pt[0]+val, pt[1]-val*sqrt(3)/2, 1, 1));

View File

@ -1299,16 +1299,16 @@ EX void apply() {
case maRotation:
if(GDIM == 3) shift_view(ztangent(-rotation_distance));
rotate_view(movement_angle.get());
rotate_view(spin(TAU * t / period));
rotate_view(rot_inverse(movement_angle.get()));
rotate_view(spin(TAU * t / period));
rotate_view(movement_angle.get());
if(GDIM == 3) shift_view(ztangent(rotation_distance));
moved();
break;
case maTranslationRotation:
shift_view(
rot_inverse(movement_angle.get()) * xtangent(cycle_length * t / period)
movement_angle.get() * xtangent(cycle_length * t / period)
);
moved();
rotate_view(cspin(0, GDIM-1, TAU * t / period));
@ -1320,19 +1320,21 @@ EX void apply() {
#if CAP_BT
case maParabolic:
reflect_view();
View = movement_angle.get() * View;
rotate_view(rot_inverse(movement_angle.get()));
if(GDIM == 2)
View = bt::parabolic(parabolic_length * t / period) * View;
else
View = bt::parabolic3(parabolic_length * t / period, 0) * View;
View = rot_inverse(movement_angle.get()) * View;
rotate_view(movement_angle.get());
moved();
break;
#endif
case maCircle: {
rotate_view(rot_inverse(movement_angle.get()));
centerover = rotation_center;
ld alpha = circle_spins * TAU * ticks / period;
View = spin(-cos_auto(circle_radius)*alpha) * xpush(circle_radius) * spin(alpha) * rotation_center_View;
rotate_view(movement_angle.get());
moved();
break;
}