discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Unexpected $vpr behavior

B
bmihuraca
Tue, Dec 8, 2020 6:53 PM

The "viewport rotation" special variable doesn't behave like I expect. I
expect the view to rotate around whichever axis is changed, therefore it
should stay still on my computer screen.

Take this code for example:

$vpr = [55, 0, 25];
text("Hello");

When I change the z-axis by 20 degrees, it does not move on my computer
screen.

But when I change the x- or y-axes by 20 degrees, they move substantially.

Is this a bug or am I not understanding something?

--
Sent from: http://forum.openscad.org/

The "viewport rotation" special variable doesn't behave like I expect. I expect the view to rotate around whichever axis is changed, therefore it should stay still on my computer screen. Take this code for example: $vpr = [55, 0, 25]; text("Hello"); When I change the z-axis by 20 degrees, it does not move on my computer screen. But when I change the x- or y-axes by 20 degrees, they move substantially. Is this a bug or am I not understanding something? -- Sent from: http://forum.openscad.org/
D
David
Tue, Dec 8, 2020 7:00 PM

Isn't text handled differently in OpenSCAD?  It's not handled as most
graphics primitives except sometimes.  Of course, I could be wrong.

On 12/8/20 12:53 PM, bmihuraca via Discuss wrote:

The "viewport rotation" special variable doesn't behave like I expect. I
expect the view to rotate around whichever axis is changed, therefore it
should stay still on my computer screen.

Take this code for example:

$vpr = [55, 0, 25];
text("Hello");

When I change the z-axis by 20 degrees, it does not move on my computer
screen.

But when I change the x- or y-axes by 20 degrees, they move substantially.

Is this a bug or am I not understanding something?

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Isn't text handled differently in OpenSCAD?  It's not handled as most graphics primitives except sometimes.  Of course, I could be wrong. On 12/8/20 12:53 PM, bmihuraca via Discuss wrote: > The "viewport rotation" special variable doesn't behave like I expect. I > expect the view to rotate around whichever axis is changed, therefore it > should stay still on my computer screen. > > Take this code for example: > > $vpr = [55, 0, 25]; > text("Hello"); > > When I change the z-axis by 20 degrees, it does not move on my computer > screen. > > But when I change the x- or y-axes by 20 degrees, they move substantially. > > Is this a bug or am I not understanding something? > > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
B
bmihuraca
Tue, Dec 8, 2020 7:23 PM

This issue is not related to the text, just the axes. I should've left that
text line out.

--
Sent from: http://forum.openscad.org/

This issue is not related to the text, just the axes. I should've left that text line out. -- Sent from: http://forum.openscad.org/
NH
nop head
Tue, Dec 8, 2020 7:30 PM

Not sure what you mean. If I change the z rotation to 45 and do F5 the text
does rotate substantially.

[image: image.png]

On Tue, 8 Dec 2020 at 19:24, bmihuraca via Discuss <
discuss@lists.openscad.org> wrote:

This issue is not related to the text, just the axes. I should've left that
text line out.

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Not sure what you mean. If I change the z rotation to 45 and do F5 the text does rotate substantially. [image: image.png] On Tue, 8 Dec 2020 at 19:24, bmihuraca via Discuss < discuss@lists.openscad.org> wrote: > This issue is not related to the text, just the axes. I should've left that > text line out. > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
JB
Jordan Brown
Tue, Dec 8, 2020 7:37 PM

On 12/8/2020 11:00 AM, David wrote:

Isn't text handled differently in OpenSCAD?  It's not handled as most
graphics primitives except sometimes.

Text is a 2D object.  For display purposes it, like other 2D objects,
has a bit of height, but they're all still 2D.

On 12/8/20 12:53 PM, bmihuraca via Discuss wrote:

The "viewport rotation" special variable doesn't behave like I expect. I
expect the view to rotate around whichever axis is changed, therefore it
should stay still on my computer screen.

Take this code for example:

$vpr = [55, 0, 25];
text("Hello");

When I change the z-axis by 20 degrees, it does not move on my computer
screen.

But when I change the x- or y-axes by 20 degrees, they move
substantially.

Is this a bug or am I not understanding something?

I have trouble visualizing it myself, but I think what you're seeing is
one of three things:

  • When you rotate in two axes, there's a related rotation in the third.
  • Like other OpenSCAD rotations, the Z rotation is done last.
  • View rotation is around the center of the window.  If the origin
    isn't at the center of the window, rotating around Z causes the Z
    axis to move too.

Try playing with one axis at a time, keeping the other two set to zero.

Set this animation going, then pan with your mouse and manually change
the numbers for the rotation of the two non-animated axes:

$vpr = [0,0, $t*360];
text("Hello"); 

(If you're not familiar with animation:  View/Animate to get the
controls to appear, then put (say) 10 in the FPS box and 90 in the Steps
box.)

Of course, you can move the $t*360 to whichever axis you like.

You might also set

$vpt=[0,0,0];

to force the origin to the center.

Caution:  animated rotation of more than one axis a can make you dizzy!

On 12/8/2020 11:00 AM, David wrote: > Isn't text handled differently in OpenSCAD?  It's not handled as most > graphics primitives except sometimes. Text is a 2D object.  For display purposes it, like other 2D objects, has a bit of height, but they're all still 2D. > On 12/8/20 12:53 PM, bmihuraca via Discuss wrote: >> The "viewport rotation" special variable doesn't behave like I expect. I >> expect the view to rotate around whichever axis is changed, therefore it >> should stay still on my computer screen. >> >> Take this code for example: >> >> $vpr = [55, 0, 25]; >> text("Hello"); >> >> When I change the z-axis by 20 degrees, it does not move on my computer >> screen. >> >> But when I change the x- or y-axes by 20 degrees, they move >> substantially. >> >> Is this a bug or am I not understanding something? I have trouble visualizing it myself, but I think what you're seeing is one of three things: * When you rotate in two axes, there's a related rotation in the third. * Like other OpenSCAD rotations, the Z rotation is done last. * View rotation is around the center of the window.  If the origin isn't at the center of the window, rotating around Z causes the Z axis to move too. Try playing with one axis at a time, keeping the other two set to zero. Set this animation going, then pan with your mouse and manually change the numbers for the rotation of the two non-animated axes: $vpr = [0,0, $t*360]; text("Hello"); (If you're not familiar with animation:  View/Animate to get the controls to appear, then put (say) 10 in the FPS box and 90 in the Steps box.) Of course, you can move the $t*360 to whichever axis you like. You might also set $vpt=[0,0,0]; to force the origin to the center. Caution:  animated rotation of more than one axis a can make you dizzy!
B
bmihuraca
Tue, Dec 8, 2020 7:58 PM

Ack, everybody is focused on the text! I am only concerned about the axes.

Next month I'll post the same question without the line of text.

--
Sent from: http://forum.openscad.org/

Ack, everybody is focused on the text! I am only concerned about the axes. Next month I'll post the same question without the line of text. -- Sent from: http://forum.openscad.org/
NH
nop head
Tue, Dec 8, 2020 8:27 PM

I still don't understand what you mean. The text is always aligned with X
and Y axes. The view angles changes according to the GUI or the $vpr
setting that initially sets the GUI value but the mouse can change it until
F5 is hit again.

On Tue, 8 Dec 2020 at 19:58, bmihuraca via Discuss <
discuss@lists.openscad.org> wrote:

Ack, everybody is focused on the text! I am only concerned about the axes.

Next month I'll post the same question without the line of text.

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I still don't understand what you mean. The text is always aligned with X and Y axes. The view angles changes according to the GUI or the $vpr setting that initially sets the GUI value but the mouse can change it until F5 is hit again. On Tue, 8 Dec 2020 at 19:58, bmihuraca via Discuss < discuss@lists.openscad.org> wrote: > Ack, everybody is focused on the text! I am only concerned about the axes. > > Next month I'll post the same question without the line of text. > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
JB
Jordan Brown
Tue, Dec 8, 2020 8:53 PM

On 12/8/2020 11:58 AM, bmihuraca via Discuss wrote:

Ack, everybody is focused on the text! I am only concerned about the axes.

No, sorry, I got what you meant.  I responded to the other guy's text
comment, and then to yours; perhaps I erred in combining the two and you
missed the response to your question.

Here it is again.  I've retained the text() invocation from your
original.  It's not necessary for the demonstration, but it can help
keep track of which axis is which as you spin the world around.


I have trouble visualizing it myself, but I think what you're seeing is
one of three things:

  • When you rotate in two axes, there's a related rotation in the third.
  • Like other OpenSCAD rotations, the Z rotation is done last.
  • View rotation is around the center of the window.  If the origin
    isn't at the center of the window, rotating around Z causes the Z
    axis to move too.

Try playing with one axis at a time, keeping the other two set to zero.

Set this animation going, then pan with your mouse and manually change
the numbers for the rotation of the two non-animated axes:

$vpr = [0,0, $t*360];
text("Hello"); 

(If you're not familiar with animation:  View/Animate to get the
controls to appear, then put (say) 10 in the FPS box and 90 in the Steps
box.)

Of course, you can move the $t*360 to whichever axis you like.

You might also set

$vpt=[0,0,0];

to force the origin to the center.

Caution:  animated rotation of more than one axis a can make you dizzy!

On 12/8/2020 11:58 AM, bmihuraca via Discuss wrote: > Ack, everybody is focused on the text! I am only concerned about the axes. > No, sorry, I got what you meant.  I responded to the other guy's text comment, and then to yours; perhaps I erred in combining the two and you missed the response to your question. Here it is again.  I've retained the text() invocation from your original.  It's not necessary for the demonstration, but it can help keep track of which axis is which as you spin the world around. --- I have trouble visualizing it myself, but I think what you're seeing is one of three things: * When you rotate in two axes, there's a related rotation in the third. * Like other OpenSCAD rotations, the Z rotation is done last. * View rotation is around the center of the window.  If the origin isn't at the center of the window, rotating around Z causes the Z axis to move too. Try playing with one axis at a time, keeping the other two set to zero. Set this animation going, then pan with your mouse and manually change the numbers for the rotation of the two non-animated axes: $vpr = [0,0, $t*360]; text("Hello"); (If you're not familiar with animation:  View/Animate to get the controls to appear, then put (say) 10 in the FPS box and 90 in the Steps box.) Of course, you can move the $t*360 to whichever axis you like. You might also set $vpt=[0,0,0]; to force the origin to the center. Caution:  animated rotation of more than one axis a can make you dizzy!
JB
Jordan Brown
Tue, Dec 8, 2020 9:20 PM

Another note:

Again, I have some trouble visualizing what's really going on and why,
but note that OpenSCAD's viewer normally constrains rotation.  I'm not
quite sure what the constraint is or what it deeply means, but as long
as you're centered on the origin ($vpt=[0,0,0]; look at the bottom of
the window) you can't get the Z axis to appear off vertical.  (It can
tilt towards you or away from you, but never left or right.)

Another way to look at it is that if you're looking at a model of a
globe (ignoring axial tilt), you can't get the north pole to be on the
left or right side.

Probably strongly related is that the ordinary mouse controls never
change the Y axis rotation - it's always zero.  (Watch the rotation
numbers at the bottom of the screen.)

I suspect that the X and Z axis rotations map to altitude and azimuth,
or in spherical coordinates theta θ and phi φ.

When you set $vpr, you can set the Y rotation and so you can move the Z
axis off vertical.  For instance, [0,90,0] has the north pole pointed left.

(And forcing the Y rotation non-zero using $vpr then yields strange
effects in the mouse-based rotation.)

Another note: Again, I have some trouble visualizing what's really going on and why, but note that OpenSCAD's viewer normally constrains rotation.  I'm not quite sure what the constraint is or what it deeply means, but as long as you're centered on the origin ($vpt=[0,0,0]; look at the bottom of the window) you can't get the Z axis to appear off vertical.  (It can tilt towards you or away from you, but never left or right.) Another way to look at it is that if you're looking at a model of a globe (ignoring axial tilt), you can't get the north pole to be on the left or right side. Probably strongly related is that the ordinary mouse controls never change the Y axis rotation - it's always zero.  (Watch the rotation numbers at the bottom of the screen.) I suspect that the X and Z axis rotations map to altitude and azimuth, or in spherical coordinates theta θ and phi φ. When you set $vpr, you can set the Y rotation and so you can move the Z axis off vertical.  For instance, [0,90,0] has the north pole pointed left. (And forcing the Y rotation non-zero using $vpr then yields strange effects in the mouse-based rotation.)
B
bmihuraca
Tue, Dec 8, 2020 9:59 PM

I didn't explain it well enough to begin with; here's a picture (hopefully),
and I would expect the x-axis to have the same angle:

http://forum.openscad.org/file/t3042/OpenSCAD_%24vpr_issue.png

--
Sent from: http://forum.openscad.org/

I didn't explain it well enough to begin with; here's a picture (hopefully), and I would expect the x-axis to have the same angle: <http://forum.openscad.org/file/t3042/OpenSCAD_%24vpr_issue.png> -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Tue, Dec 8, 2020 10:38 PM

JordanBrown wrote

I'm not quite sure what the constraint is or what it deeply means, but as
long
as you're centered on the origin ($vpt=[0,0,0]; look at the bottom of
the window) you can't get the Z axis to appear off vertical.  (It can
tilt towards you or away from you, but never left or right.)

Jordan, try Shift-drag.

Bruce,

Try this with Animate;

cube([100,10,10]);
cylinder(r=5,h=100,center=true);
$vpr=[$vpr[0],$vpr[1],$t*360];

Then drag & shift-drag. Note the rotate=[] at the bottom of the window.
Noting $vpr=[?,?,nnn] rotates AROUND Z.

Replace the third value with $vpr[2], then use $t360 in X then Y.
Then make all three $t
360.


OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

  • on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/

JordanBrown wrote > I'm not quite sure what the constraint is or what it deeply means, but as > long > as you're centered on the origin ($vpt=[0,0,0]; look at the bottom of > the window) you can't get the Z axis to appear off vertical.  (It can > tilt towards you or away from you, but never left or right.) Jordan, try Shift-drag. Bruce, Try this with Animate; cube([100,10,10]); cylinder(r=5,h=100,center=true); $vpr=[$vpr[0],$vpr[1],$t*360]; Then drag & shift-drag. Note the rotate=[] at the bottom of the window. Noting $vpr=[?,?,nnn] rotates AROUND Z. Replace the third value with $vpr[2], then use $t*360 in X then Y. Then make all three $t*360. ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Tue, Dec 8, 2020 11:18 PM

Here is a better one;

Rotate_x=false;
Rotate_y=false;
Rotate_z=false;

cube([100,10,10]);
cylinder(r=5,h=100,center=true);
$vpr=[  (Rotate_x) ? $t360 : $vpr.x,
(Rotate_y) ? $t
360 : $vpr.y,
(Rotate_z) ? $t*360 : $vpr.z];

Show customizer, then select which axis to rotate dynamically.

Select one at a time, then use the Top/Bottom/Left/Right/Front/Back cube
buttons to explore what is rotating.

Now, the Viewport axes are X - left/right, Y - up/down, that is related to
the screen.

Now I see what bmihuraca is on about.

You would expect Z to then be AROUND the viewport depth axis, but it rotates
around the 3d-space X/Y plain.

Hmmm...


OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

  • on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/

Here is a better one; Rotate_x=false; Rotate_y=false; Rotate_z=false; cube([100,10,10]); cylinder(r=5,h=100,center=true); $vpr=[ (Rotate_x) ? $t*360 : $vpr.x, (Rotate_y) ? $t*360 : $vpr.y, (Rotate_z) ? $t*360 : $vpr.z]; Show customizer, then select which axis to rotate dynamically. Select one at a time, then use the Top/Bottom/Left/Right/Front/Back cube buttons to explore what is rotating. Now, the Viewport axes are X - left/right, Y - up/down, that is related to the screen. Now I see what bmihuraca is on about. You would expect Z to then be AROUND the viewport depth axis, but it rotates around the 3d-space X/Y plain. Hmmm... ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/
W
Whosawhatsis
Tue, Dec 8, 2020 11:33 PM

The viewport's depth axis is Y, not Z. If you rotate Y (which you can't do
with your mouse, but you can do with $vpr), the Z axis will tilt in the
display. X is pitch, Y is roll, Z is yaw.

On December 8, 2020 at 15:19:13, MichaelAtOz (oz.at.michael@gmail.com)
wrote:

Here is a better one;

Rotate_x=false;
Rotate_y=false;
Rotate_z=false;

cube([100,10,10]);
cylinder(r=5,h=100,center=true);
$vpr=[ (Rotate_x) ? $t360 : $vpr.x,
(Rotate_y) ? $t
360 : $vpr.y,
(Rotate_z) ? $t*360 : $vpr.z];

Show customizer, then select which axis to rotate dynamically.

Select one at a time, then use the Top/Bottom/Left/Right/Front/Back cube
buttons to explore what is rotating.

Now, the Viewport axes are X - left/right, Y - up/down, that is related to
the screen.

Now I see what bmihuraca is on about.

You would expect Z to then be AROUND the viewport depth axis, but it
rotates
around the 3d-space X/Y plain.

Hmmm...


OpenSCAD Admin - email* me if you need anything, or if I've done something
stupid...

  • on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public
Domain; to the extent possible under law, I have waived all copyright and
related or neighbouring rights to this work. Obviously inclusion of works
of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

The viewport's depth axis is Y, not Z. If you rotate Y (which you can't do with your mouse, but you can do with $vpr), the Z axis will tilt in the display. X is pitch, Y is roll, Z is yaw. On December 8, 2020 at 15:19:13, MichaelAtOz (oz.at.michael@gmail.com) wrote: Here is a better one; Rotate_x=false; Rotate_y=false; Rotate_z=false; cube([100,10,10]); cylinder(r=5,h=100,center=true); $vpr=[ (Rotate_x) ? $t*360 : $vpr.x, (Rotate_y) ? $t*360 : $vpr.y, (Rotate_z) ? $t*360 : $vpr.z]; Show customizer, then select which axis to rotate dynamically. Select one at a time, then use the Top/Bottom/Left/Right/Front/Back cube buttons to explore what is rotating. Now, the Viewport axes are X - left/right, Y - up/down, that is related to the screen. Now I see what bmihuraca is on about. You would expect Z to then be AROUND the viewport depth axis, but it rotates around the 3d-space X/Y plain. Hmmm... ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list Discuss@lists.openscad.org http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
W
Whosawhatsis
Tue, Dec 8, 2020 11:42 PM

I will say, though, that given this, it's odd that $vpr = [0, 0, 0] gives
you a top-down view. [0,  0, 0] being a front view would be more
consistent...

On December 8, 2020 at 15:33:14, Whosawhatsis (whosawhatsis@gmail.com)
wrote:

The viewport's depth axis is Y, not Z. If you rotate Y (which you can't do
with your mouse, but you can do with $vpr), the Z axis will tilt in the
display. X is pitch, Y is roll, Z is yaw.

On December 8, 2020 at 15:19:13, MichaelAtOz (oz.at.michael@gmail.com)
wrote:

Here is a better one;

Rotate_x=false;
Rotate_y=false;
Rotate_z=false;

cube([100,10,10]);
cylinder(r=5,h=100,center=true);
$vpr=[ (Rotate_x) ? $t360 : $vpr.x,
(Rotate_y) ? $t
360 : $vpr.y,
(Rotate_z) ? $t*360 : $vpr.z];

Show customizer, then select which axis to rotate dynamically.

Select one at a time, then use the Top/Bottom/Left/Right/Front/Back cube
buttons to explore what is rotating.

Now, the Viewport axes are X - left/right, Y - up/down, that is related to
the screen.

Now I see what bmihuraca is on about.

You would expect Z to then be AROUND the viewport depth axis, but it
rotates
around the 3d-space X/Y plain.

Hmmm...


OpenSCAD Admin - email* me if you need anything, or if I've done something
stupid...

  • on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public
Domain; to the extent possible under law, I have waived all copyright and
related or neighbouring rights to this work. Obviously inclusion of works
of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I will say, though, that given this, it's odd that $vpr = [0, 0, 0] gives you a top-down view. [0, 0, 0] being a front view would be more consistent... On December 8, 2020 at 15:33:14, Whosawhatsis (whosawhatsis@gmail.com) wrote: The viewport's depth axis is Y, not Z. If you rotate Y (which you can't do with your mouse, but you can do with $vpr), the Z axis will tilt in the display. X is pitch, Y is roll, Z is yaw. On December 8, 2020 at 15:19:13, MichaelAtOz (oz.at.michael@gmail.com) wrote: Here is a better one; Rotate_x=false; Rotate_y=false; Rotate_z=false; cube([100,10,10]); cylinder(r=5,h=100,center=true); $vpr=[ (Rotate_x) ? $t*360 : $vpr.x, (Rotate_y) ? $t*360 : $vpr.y, (Rotate_z) ? $t*360 : $vpr.z]; Show customizer, then select which axis to rotate dynamically. Select one at a time, then use the Top/Bottom/Left/Right/Front/Back cube buttons to explore what is rotating. Now, the Viewport axes are X - left/right, Y - up/down, that is related to the screen. Now I see what bmihuraca is on about. You would expect Z to then be AROUND the viewport depth axis, but it rotates around the 3d-space X/Y plain. Hmmm... ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list Discuss@lists.openscad.org http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
M
MichaelAtOz
Wed, Dec 9, 2020 12:16 AM

Whosawhatsis wrote

If you rotate Y (which you can't do with your mouse, but you can do with
$vpr), the Z axis will tilt in the
display.

You can with shift-drag.
Do Reset-view, then View-top.
Then shift-drag with left-right movement, it rotates about the screen
up-down axis while looking at rotate=[] at the bottom of the screen, Y
changes. Then Reset-view, ie diagonal, do the same drag.

The viewport's depth axis is Y, not Z.

Do View-top, then move mouse to bottom/right corner, drag toward
bottom-left,
ie rotate around depth, see rotate=[], Z changes.

X is pitch, Y is roll, Z is yaw.

Like graph paper,
left-right is the X-axis, thus rotate-X = pitch,
up/down is the Y-axis, rotate-Y = roll,
top/bottom is Z-axis, rotate-Z should = viewport yaw,
but changing $vpr Z does not yaw the viewport, it yaws the 3D-space Z-axis.

Play with that code & customizer, select only Rotate_Z, click view-left.


OpenSCAD Admin - email* me if you need anything,  or if I've done something stupid...

  • on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

--
Sent from: http://forum.openscad.org/

Whosawhatsis wrote > If you rotate Y (which you can't do with your mouse, but you can do with > $vpr), the Z axis will tilt in the > display. You can with shift-drag. Do Reset-view, then View-top. Then shift-drag with left-right movement, it rotates about the screen up-down axis while looking at rotate=[] at the bottom of the screen, Y changes. Then Reset-view, ie diagonal, do the same drag. > The viewport's depth axis is Y, not Z. Do View-top, then move mouse to bottom/right corner, drag toward bottom-left, ie rotate around depth, see rotate=[], Z changes. > X is pitch, Y is roll, Z is yaw. Like graph paper, left-right is the X-axis, thus rotate-X = pitch, up/down is the Y-axis, rotate-Y = roll, top/bottom is Z-axis, rotate-Z should = viewport yaw, but changing $vpr Z does not yaw the viewport, it yaws the 3D-space Z-axis. Play with that code & customizer, select only Rotate_Z, click view-left. ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/
JB
Jordan Brown
Wed, Dec 9, 2020 1:32 AM

On 12/8/2020 3:18 PM, MichaelAtOz wrote:

You would expect Z to then be AROUND the viewport depth axis, but it rotates
around the 3d-space X/Y plain.

So far it seems totally consistent to me.

Each rotation rotates the object around the specified axis - whichever
way that axis points right now.  (But first offset by $vpt.)

The key thing is that if you have [ rx, 0, rz ] it first rotates
around the X axis and then rotates around the Z axis.

Since rotating around the X axis moves the Z axis off vertical, rotating
around Z causes the X axis line to move on the screen.

I think that's the effect that Bruce is talking about.

Bruce:  if you keep the Y and Z rotations zero, I think you'll see that
rotating around X works exactly as you expect.  Similarly, if you keep
the Z rotation zero, rotating around Y works as you expect (even if X
rotation is non-zero).

I suspect that it is a deep philosophical question whether what is
happening is that the universe is turning (around $vpt) while the camera
remains still, or if the camera is orbiting $vpt while continuing to
point at it.

What it definitely isn't is turning the camera.  The camera always
points at $vpt.

I think.

On 12/8/2020 3:18 PM, MichaelAtOz wrote: > You would expect Z to then be AROUND the viewport depth axis, but it rotates > around the 3d-space X/Y plain. So far it seems totally consistent to me. Each rotation rotates the object around the specified axis - whichever way that axis points right now.  (But first offset by $vpt.) The key thing is that if you have [ rx, 0, rz ] it *first* rotates around the X axis and *then* rotates around the Z axis. Since rotating around the X axis moves the Z axis off vertical, rotating around Z causes the X axis line to move on the screen. I think that's the effect that Bruce is talking about. Bruce:  if you keep the Y and Z rotations zero, I think you'll see that rotating around X works exactly as you expect.  Similarly, if you keep the Z rotation zero, rotating around Y works as you expect (even if X rotation is non-zero). I suspect that it is a deep philosophical question whether what is happening is that the universe is turning (around $vpt) while the camera remains still, or if the camera is orbiting $vpt while continuing to point at it. What it definitely *isn't* is turning the camera.  The camera always points at $vpt. I think.
JB
Jordan Brown
Wed, Dec 9, 2020 1:36 AM

On 12/8/2020 5:32 PM, Jordan Brown wrote:

On 12/8/2020 3:18 PM, MichaelAtOz wrote:

You would expect Z to then be AROUND the viewport depth axis, but it rotates
around the 3d-space X/Y plain.

So far it seems totally consistent to me.

Each rotation rotates the object around the specified axis - whichever
way that axis points right now.  (But first offset by $vpt.)

The key thing is that if you have [ rx, 0, rz ] it first rotates
around the X axis and then rotates around the Z axis.

Since rotating around the X axis moves the Z axis off vertical,
rotating around Z causes the X axis line to move on the screen.

... moves the Z axis off of screen vertical ...

I think that's the effect that Bruce is talking about.

Bruce:  if you keep the Y and Z rotations zero, I think you'll see
that rotating around X works exactly as you expect.  Similarly, if you
keep the Z rotation zero, rotating around Y works as you expect (even
if X rotation is non-zero).

I suspect that it is a deep philosophical question whether what is
happening is that the universe is turning (around $vpt) while the
camera remains still, or if the camera is orbiting $vpt while
continuing to point at it.

What it definitely isn't is turning the camera.  The camera always
points at $vpt.

I think.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

On 12/8/2020 5:32 PM, Jordan Brown wrote: > On 12/8/2020 3:18 PM, MichaelAtOz wrote: >> You would expect Z to then be AROUND the viewport depth axis, but it rotates >> around the 3d-space X/Y plain. > > So far it seems totally consistent to me. > > Each rotation rotates the object around the specified axis - whichever > way that axis points right now.  (But first offset by $vpt.) > > The key thing is that if you have [ rx, 0, rz ] it *first* rotates > around the X axis and *then* rotates around the Z axis. > > Since rotating around the X axis moves the Z axis off vertical, > rotating around Z causes the X axis line to move on the screen. ... moves the Z axis off of *screen* vertical ... > > I think that's the effect that Bruce is talking about. > > Bruce:  if you keep the Y and Z rotations zero, I think you'll see > that rotating around X works exactly as you expect.  Similarly, if you > keep the Z rotation zero, rotating around Y works as you expect (even > if X rotation is non-zero). > > I suspect that it is a deep philosophical question whether what is > happening is that the universe is turning (around $vpt) while the > camera remains still, or if the camera is orbiting $vpt while > continuing to point at it. > > What it definitely *isn't* is turning the camera.  The camera always > points at $vpt. > > I think. > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
B
bmihuraca
Wed, Dec 9, 2020 1:59 PM

Yes MichaelAtOz,

That is a good demo of what I am getting at.

Bruce

--
Sent from: http://forum.openscad.org/

Yes MichaelAtOz, That is a good demo of what I am getting at. Bruce -- Sent from: http://forum.openscad.org/
B
bmihuraca
Wed, Dec 9, 2020 2:10 PM

Just testing to see if my username shows up after enabling mail options...

--
Sent from: http://forum.openscad.org/

Just testing to see if my username shows up after enabling mail options... -- Sent from: http://forum.openscad.org/