discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Unexpected $vpr behavior

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/