Author Topic: Yet Another 3D Viewer  (Read 10901 times)

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Yet Another 3D Viewer
« Reply #15 on: April 20, 2014, 03:57:49 AM »
Ok, I'm describing some of my "work flow habits" but I mention them in case Bd finds them interesting for his most excellent vdd.d3m program.

So in the above post, I mention I have a "home" key which I hit that lets you get your bearings, so to speak.  The routine also takes a quick "viewsave now" before it puts me into my favorite "home" view settings.    To get back to where you just came from (meaning the view), I have a restore view routine that does a "readview now". 

Hopefully you get the work flow.  You're in tight doing something, you get lost, you go "home" to get your bearings, then you dive back in.



Edit:  I should also mention that I work with one large maximized window because I crave as much screen real estate as possible.  In other words, I don't use the DesignCAD 3d standard tiling.  Hence I pop into and out of my favorite views using basiccad.  tv.d3m (top view), rv.d3m (right view), fv.d3m (front view), etc. . . . .

Talking about perspective view depth (another thread), did you hear about the guy with the 120" wide screen monitor?  A future of exotropia cases (Marty Feldman, a very happy DesignCAD user, perhaps using vdd.d3m).  :)

« Last Edit: April 20, 2014, 07:36:27 AM by prl »

Bob P

  • Hero Member
  • *****
  • Posts: 1207
    • Era Replica Automobiles
Re: Yet Another 3D Viewer
« Reply #16 on: April 20, 2014, 04:30:05 AM »
Here's a feature request:  Let us drag a view(s) onto another monitor.  You can already drag the Info Box there.

samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #17 on: April 20, 2014, 04:57:33 AM »
Just some commentary from the peanut gallery.
Really like left right arrows for "Bearing" and "Elevation";
s to cycle renders,
p, 0, n/f
etc etc 

However when it comes to zooming and panning,
I prefer Ctrl+roller for zooming
Alt+roller for pan vertical
Shift + roller for pan horiz  (I'm talking V22.1;   V23 has other options I know, like zoom into top right corner etc).
And you can use these WITHIN the macro without it stopping.
« Last Edit: April 20, 2014, 04:59:08 AM by samdavo »

Dr PR

  • Hero Member
  • *****
  • Posts: 5611
Re: Yet Another 3D Viewer
« Reply #18 on: April 20, 2014, 08:41:18 AM »
prl,

Good ideas!

Phil
DesignCAD user since 1987

bdeck

  • Hero Member
  • *****
  • Posts: 896
Re: Yet Another 3D Viewer
« Reply #19 on: April 20, 2014, 12:20:54 PM »
Wow.... what have I started?

BobP,
I dont have a second monitor for testing. Can you drag a view window to a second monitor or open a new one there?

Prl,

The zero key is presently the home key, but the next version will have a view save feature and the ability to recall a view by cycling through all the previously saved views. If you have saved only one view, then that will be the home. (Edit: maybe later.)

Some of the features will be difficult to implement without an external executable, which I shall try to avoid.

BUG:

If you maximize a view window, DC fails to recognize the restore or minimize buttons while in the macro. One way to recover is to use the cascade command (not dctiles). (Edit: added in later version 0.05)

More later.
BD


« Last Edit: April 22, 2014, 06:13:04 AM by bdeck »

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Yet Another 3D Viewer
« Reply #20 on: April 20, 2014, 12:48:12 PM »
I dont have a second monitor for testing. Can you drag a view window to a second monitor or open a new one there?

I know you asked BobP, but I can answer this.  No.  All  DesignCAD views are "child" windows and are locked into the parent window (DesignCAD)  frame.  Edit . . . I removed the rest of my rant. . .meaningless today.
« Last Edit: April 20, 2014, 05:58:01 PM by prl »

samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #21 on: April 20, 2014, 03:42:06 PM »
but the next version will have a view save feature and the ability to recall a view by cycling through all the previously saved views. If you have saved only one view, then that will be the home.
BD

BD - there is a simple trick to saving views whilst using your macro.  (Hope I'm right - but it worked ok just then). albeit a temporary save

When running the vdd macro,  and you like a view,
a) Ctrl+one"roller click" of the mouse roller in
b)  then the same thing out,  (i.e. Ctrl + one small roll of the roller out).
(What you have done is effectively save that view) - call it an in-out camera.

then continue with arrows to left/right  or up/down whatever,  (also n/f;  also zoom in/out etc - easiest done with the roller btw)...
again when you are happy then do a small "Ctrl+mouseroller in-and-out snapshot" = you have saved a second view.

ok - now stop the program.
And you should be able to cycle BACK through your selected views using Ctrl+M  ( and return forward again using Ctrl+Shift+M).    ok, return-forward-again cannot be guaranteed it seems :)  in fact IT DOESN'T WORK.   Bit like a home-made time-travel machine.
cheers

PS What you have to do is make the best of the one and only time travel experience back through all your views - i.e. as Ctrl+M presents you with one of the "quick-in-out views", then you save that view with "Save Current View".  And so on back through the views  (2 cents)
« Last Edit: April 20, 2014, 06:05:38 PM by samdavo »

bdeck

  • Hero Member
  • *****
  • Posts: 896
Re: Yet Another 3D Viewer
« Reply #22 on: April 21, 2014, 12:22:47 AM »
.....  sometimes two of the four toggled views are almost identical.....

Sam,

Thanks for the comments.

All of the 4 modes in the macro are currently hardware accelerated modes. The two that look most similar differ only by a hardware smoothing algorithm which can be seen in the dome of the Hotel sample drawing from IMSI.

I've added an F8 key to bring up the shading dialog within the macro, and an L key to bring up the lighting dialog. I'll post when Ive had time to proof it.

Also a z key to allow user to define a zoom window.

Your mention of skipping from window to window prompted me add code to help the macro know which window it is in, and increment from the correct starting state.

Good to know I don't need to do more on zoom and pan. Still, I've used w and z for so long as my navigation tools, that I have pretty much forgotten the wheel is on the mouse.

Regards,

bd


« Last Edit: June 07, 2015, 12:04:14 AM by bdeck »

samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #23 on: April 21, 2014, 01:52:41 AM »
bd
What I should have emphasised before was that your program behaves predictably if you go in with accelerator on. 

As for zooming with the wheel - there is a positive spinoff ( as per my previous post) and that is that you can use Ctrl+M to return to those views , i.e. they are saved.

I remember Ctrl+M because it is Ctrl+W upside down :)

I mention something else (pretty trivial) but if you are making an animated gif, or walkthrough,  then you can include an effective Isometric view, by
a) setting P to non-perspective
b) setting q to 5 deg increments
c) start with "0"
d) rotate about H and V using arrows,  i.e. right arrow 9 times ( = 45 degrees), and up arrow 7 times ( = 35 degrees, near enough to 35.26degs , which is slightly more accurate)
cheers 
thanks again


prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Yet Another 3D Viewer
« Reply #24 on: April 21, 2014, 05:57:35 AM »
I remember Ctrl+M because it is Ctrl+W upside down :)

Ctrl+W because it is Ctrl+M downside up.   :)

I had forgotten that DesignCAD has a previous zoom view buffer, similar to Undo but for previous views.   Can't remember if it works with BasicCAD invoked view changes.  That may be the issue why I don't recall or use it.


samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #25 on: April 21, 2014, 03:27:22 PM »
prl
what's more, it recalls all views back to opening the file -  even BEFORE the last save or the one before that (assuming you have saved a couple of times since you opened it).  cheers

PS It is extremely reliable in 2D,  Including Ctrl+Shift+M to come forward through the "buffer" again.   Not so sure about 3D - and I can't get Ctrl+Shift+M to work after a 3D vdd episode for instance (including quick-in-out-snapshots) - using the jargon as described in post #22 back there. 
« Last Edit: April 21, 2014, 03:55:30 PM by samdavo »

bdeck

  • Hero Member
  • *****
  • Posts: 896
Re: Yet Another 3D Viewer
« Reply #26 on: April 21, 2014, 09:30:47 PM »
Heres the last of the simple versions.

Changes:
Some functions have been moved to new keys to free up the old key for other use.
Functionality of S key now moved to the R key for render.
Functionality of 0 key now moved to the Home key. to prevent accidental zeroing of angles.
Functionality of N key now moved to the C key for closer. (C is closer to the F key)
Functionality of P key now moved to the I key for isotoggle.
Except for the N key, prior functionality of all replaced keys has been retained. (either the new key or the old key will work for that function until  .... )
The Q key now affects zooms and radial movement as well as angular movement. (note: very large radial view distance causes GL hardware errors on my old vid card.)

New functions
Z  zoom window by setting two points
N  open a new view window
K cascade all views (useful for recovery from loss of control of maximized window)
x set new view center by setting one or 2 points.
F8 open render dialog
L open lighting dialog
O cycle orthogonal views
T top view
B bottom view
PgUp / PgDn   move view up and down 30 degrees at a time.

Fixes:
1) When restarting vdd macro, it will not automatically change the view center unless requested by the user.
2) When moving from one window to another, macro will now initialize itself with info for the current view of its new window.
3) Pan and view center function include a movecursor command to force display of message in status bar without moving mouse.
4) ShadeCycle subroutine now has a line to set sys(72) for hardware acceleration. This line is necessary in DCv23, but was not necessary in v17. It solves a problem SamDavo mentioned about having to turn on hardware accell prior to starting the macro.


Bug reports, gripes, suggestions, and improvements cheerfully accepted.

bd

Edit: File v0.05 corrects typo in Homer and zeroit functions and answr$ variable name, and adds option variable for startup behavior.
Edit: File v0.06 updates sys values before regen to restore hardware accel after F8.  F8 routine also modified to keem non accelerated settings.
Edit: File v0.07 adds focus correction to zoom window command
« Last Edit: April 22, 2014, 10:50:28 AM by bdeck »

samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #27 on: April 22, 2014, 12:40:59 AM »
Well lust looking at the periphery,
I am personally unlikely to use the initial "up front" offer to set new view point - given that X can always be used as and when required (and works perfectly "later" - not sure about "up front")

View angles :-
Problem with "Home"  (some sort of error message ??)
I really like  OOOO (front side back side) and T and B (top btm).
If you go to 5 deg vertical, then change q to 15, you get 20, 35, 50, 65, 80, then it stops at 90 (makes sense, and I really like that too) - and returns with 75, 60, 45 etc -  all good, and absolutely no criticism.

Rendering :-
I really like the fact that you can "further try out or refine a view / investigate renders, lighting, view centre etc", eg set shadows with F8 and set accel off (and l = lighting and X = view centre), - and check it out - then return to cycling through the "quick(er) views" - although to be honest it tends to stay with Gouraud (?)   I think it could select "Quick (Flat)" more reliably. 

Cascading and the option of extra views :-
I added an extra (5th) view after cascading.  However, I made the mistake of not saving immediately after turning vdd off, and set "dct = designCAD tiles" - which seemed to purge the extra view (?) Maybe I'm wrong, but I think any extra views are lost if you are not careful.  Even if you then cascade, you are back to 4 views only.    The safer thing to do (if you have set extra views) is to go to Window\Tile Horizontal,  or Window\Tile Vertical.  That will show all views whether 5 or 6 or whatever ( 2 cents).  And save that.

The Q key now affects zooms and radial movement as well as angular movement. (note: very large radial view distance causes GL hardware errors on my old vid card.)
....
PgUp / PgDn   move view up and down 30 degrees at a time.
PS I suspect it is best to leave q as "fine tuning" rather than "coarse",  especially as you can get effective coarse "tilts" using Pg Up and Pg Down.  (2 cents)
« Last Edit: April 22, 2014, 01:01:02 AM by samdavo »

bdeck

  • Hero Member
  • *****
  • Posts: 896
Re: Yet Another 3D Viewer
« Reply #28 on: April 22, 2014, 05:50:48 AM »
sam,

Edited prior post with version .05.

Added a setup variable to allow user to configure startup behaviour.

Fixed typos in home zero function, and in startup process.

DC handles windows and views in a funky way. DCTiles closes all new view windows. Closing a view window also deletes the current view in that window.

Cascaded views never change position within hte cascade, so sometimes only a scroll bar is visible. But clicking the scroll bar of a cascaded window to bring it to the top  can also scroll the view right out of the window. A minor annoyance.
 
prl,

Saving a a home view is difficult without using OLE. The reason is that I can find no simple way (other than ole) to determine a window's current center or zoom level. Any ideas?

BD

« Last Edit: April 22, 2014, 06:28:35 AM by bdeck »

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Yet Another 3D Viewer
« Reply #29 on: April 22, 2014, 05:57:19 AM »
Saving a a home view is difficult without using OLE. The reason is that I can find no way (other than ole) to determine a window's current center or zoom level. Any ideas?

Supposedly, version 24 will let us determine the view center with basiccad.  So put that off to the side. Your current versions are simply marvelous.