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

bdeck

  • Hero Member
  • *****
  • Posts: 876
Re: Yet Another 3D Viewer
« Reply #30 on: April 22, 2014, 06:26:07 AM »
Supposedly, version 24 will let us determine the view center with basiccad.

Prl,

Thanks.

Both the view center and the current zoom level are needed. I had thought I might work backwards from the 2D view window coordinates, sys(600-603), but that sounds too much like work.   ;)

Regards,

bd



 

bdeck

  • Hero Member
  • *****
  • Posts: 876
Re: Yet Another 3D Viewer
« Reply #31 on: April 22, 2014, 07:57:03 AM »
New Version 0.07 (in message 27) updates sys() values prior to regen to reinstate hardware accel after F8.  Also F8 routine was changed.

Sam,

I think the changes made in v0.06 fix the behavior you described. F8 dialog (in DCv23) is no longer affected by vdd settings. So one can simply press F8, then Enter, and the previous Phong etc rendering settings will be applied.

After F8 vdd now reverts immediately to its previous accelerated settings when a navigation key is pressed.

DCv23 behavior in this area is an improvement over DCv20.

bd
« Last Edit: April 22, 2014, 10:57:13 AM by bdeck »

samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #32 on: April 23, 2014, 02:15:50 AM »
thanks heaps bdeck.
hours to fully check it out, but it yodels possibilities :)

samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #33 on: April 24, 2014, 02:26:19 AM »
Herewith an idea for (imo) an improvement:-
namely the ability to take snapshots at steps during the "walkthrough".   eg using the hotkey "S" ( within vdd.d3m).

Not sure who I am appealing to here (but I'm thinking prl, your champion lol)

I suspect the filename(s) of the screensnaps would have to be linked to the time (eg @now),  so that bmp's/jpegs can be sorted later - then turned into a gifmovie as per prl's macro (attached).
The following excerpt is adapted from that macro, but still needs work.   
 
 
Quote
   gosub SnapPic

'subroutines follow

SnapPic:
    xx = xx + 1
    precision 0
    a$ = abs(xx)
   
    'put graphic file name in following format, 001 or 012 or 113
    if len(a$)=1 then a$="00"+a$
    if len(a$)=2 then a$="0"+a$
    pic$="c:\stuff\pic"+a$+".png" 'a directory of your choosing
   
    >shadeview
    {
    <ShowLine 0
    }

    >SaveBmp
    {
    <ShowLine 0
    <Filename [pic$]
    }
Return
« Last Edit: April 24, 2014, 02:29:50 AM by samdavo »

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Yet Another 3D Viewer
« Reply #34 on: April 24, 2014, 02:33:31 AM »
If we take out the >shadeview portion (since we are controlling that already elsewehere in vdd.d3m), we will have an interactive gif maker of sorts.

Now animated Gif files do tend to be large files, and probably best to host them off-site if one wants to have them linked for viewing on this forum.

« Last Edit: April 24, 2014, 02:51:52 AM by prl »

samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #35 on: April 24, 2014, 04:29:37 PM »
ok I have reallocated the spacebar to "snapshot".  (edit - because I can use mouse-wheel to pan)
Note that I have a directory called c:\stuff,  based on prl's idea of course ( he uses v:\stuff).   You start by cleaning that directory out - deleting all old files.

As you do your walkthrough, you hit spacebar and later on, open up that directory to find all the PNG files. (2 cents)

(Again I thank adriank for that file - I trust acceptable to use it for demonstration of the broad and distant principles here).

(edit) revised version of V0.07S - tidies up the explanation (first lines).

Note that, If you get half way through the walkthrough,  turn vddsnap off - and then continue later, you will need to set the png files to start after the current numbers - at the moment you must go into the macro and reset xx = starter for file names,  approx line 15. (2 cents)
« Last Edit: April 24, 2014, 06:37:25 PM by samdavo »

prl

  • Hero Member
  • *****
  • Posts: 3389
  • A Bézier Extrusion
Re: Yet Another 3D Viewer
« Reply #36 on: April 24, 2014, 04:36:09 PM »
Sam, thanks, I've been tilting at windmills lately. 

I do come up with creative names (stuff).  You should see how many basiccad programs I have labeled now, now1, now2, now3. . . .

bdeck

  • Hero Member
  • *****
  • Posts: 876
Re: Yet Another 3D Viewer
« Reply #37 on: April 24, 2014, 05:10:12 PM »
I'm running out of names, too.  And every day I come up with a better use for the spacebar than the one I've assigned to it.

Today I'm thinking of bringing up the help window with the space bar,  but first it needs a bit of organizing.  Any ideas?

Sam, I included your save idea (clever how I freed up the S key a few versions back, eh?) and of course I steal ideas from prl whenever I can. 

Thinking of prl's lust for screen space I added a new E mode to the macro to keep the window filled with either the entire drawing or a selection. (warning: it might make you sick)

Had trouble hiding  the saveas dialog in v23 win 2K (see notes in code). Anybody else?


This version adds the following key commands:

M  micro viewing mode toggle

S  save command for saving bitmaps, 2d projections, or views    

E  eccentric viewing mode toggle  (emode keeps all entities or all selections in view regardless of view center)

D deselect toggle   Toggles highlighting of selection.
     Selection is restored automatically at end of macro, but macro makes no attempt to restore handles.
     Selections can be un highlighted even after entering emode 2.  (emode 2 results from pressing the e key while a selection is highlighted)
    (emode 1 results from pressing the e key while no selection is highlighted) Regards,

BD

PS  Sam is that a water tower converted to a, ahem,  bachelor pad?
« Last Edit: April 24, 2014, 06:48:54 PM by bdeck »

samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #38 on: April 24, 2014, 06:06:22 PM »
Quote
Today I'm thinking of bringing up the help window with the space bar,  but first it needs a bit of organizing.  Any ideas?

Lol - well, imo, H is great for help :)
The option of saving a view as 2D dcd mid-macro (or jpeg or png etc) is pretty impressive.

One minor point, but I found that if rendering hangs up, it is sometimes worth hitting F8 to "remind it of what it's trying to do" (2 cents)
thanks again

PS As for that bedroom in the sky - it's a brilliant design and drawing by adriank :)  Comes complete with a pool.  All credit to him.   
« Last Edit: April 24, 2014, 06:17:49 PM by samdavo »

bdeck

  • Hero Member
  • *****
  • Posts: 876
Re: Yet Another 3D Viewer
« Reply #39 on: April 24, 2014, 06:34:05 PM »
The option of saving a view as 2D dcd mid-macro (or jpeg or png etc) is pretty impressive.

Well on my (win2K) machine that function works in every DC version except 23. Does it work for you?
EDIT- Fixed in later version.
bd

PS, found some truncated lines in the save menu, and fixed them with a right paren (v.09b) also, removed some lines from the dcsaver subroutine.
« Last Edit: May 25, 2014, 05:15:52 AM by bdeck »

samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #40 on: April 24, 2014, 08:11:38 PM »
bd,
Well, I am using V22.1 at home (windows 7) all good, saves jpegs and 2D drawings bumplessly.

Lol - later I forgot I was in the 2D version (having by then opened it up),  and got the fright of my life when I rotated it to see it (partially) flatten out (!)  Normally you would not be able to change view angles of a 2D drawing (!) but you can with vdd. (at least to 45degs about V axis).

Back to 3D ...  One thing I am finding, I am gonna have to make a thimble that sits over the "esc" key - sick of accidentally turning it off :)
Or maybe I'll reassign F10 or some such. - 2 cents.
« Last Edit: April 24, 2014, 08:18:56 PM by samdavo »

samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #41 on: April 24, 2014, 09:49:28 PM »
Finally succeeded in making a walkthrough! - using vddsnap,d3m
Eureka!

bdeck

  • Hero Member
  • *****
  • Posts: 876
Re: Yet Another 3D Viewer
« Reply #42 on: April 24, 2014, 10:10:05 PM »
Sam,

Very impressive, especially considering the dearth of specialized walkthrough tools in the original vdd macro.

I like the the dedicated approach of your macro, without need for submenus.

bd

ps:  I'm sure the ladies will be impressed, too.  :D
« Last Edit: April 24, 2014, 10:22:30 PM by bdeck »

samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #43 on: April 24, 2014, 11:20:26 PM »
bdeck,
 I'm using some tips from prl to make that walkthrough -

once you get all those png files in C:\stuff (using vddsnap.d3m spacebar in my case),
you open irfanview, (freeware), open Files\Batch convert
and you convert them all to gif files in one fell swoop (C:\STUFF-OUT),

then you open unfreez (more freeware), set each frame to 40/100 of a second (or slower if you wish),
and drag all the gif files into one "animated gif". 
I'm not saying it couldn't be a lot better - in fact I doubt it could be much worse - but at least I'm on the right track (I think lol).
cheers.

PS I note in your vdd09, hotkey "s" offers bitmap jpeg png and tiff - could it also offer gif (?)  { as well as view save and 2D projection}.
Just a question, no biggie.  PS I'm guessing not, since gif is not amongst the options under  DCAD\Save Image

I note that your files are automatically saved using date-and-time (compare @now) or similar - easily sorted, and I plan to use that in future - thanks.
« Last Edit: April 25, 2014, 12:48:21 AM by samdavo »

samdavo

  • Hero Member
  • *****
  • Posts: 2588
  • the trick is knowin...^ > v < - which way's up?
Re: Yet Another 3D Viewer
« Reply #44 on: April 25, 2014, 02:37:53 AM »
Here's a better walkthrough - using adriank's bedroom on stilts.   I thank him for his (formal) permission to use it.
It ends at sunset - (as I wind back the light, and the shadows take over).

Also , without changing the view centre (= centre of room) then when you increase the view distance (from about 4m), you are suddenly no longer circling inside the room, but instead you are outside.  (2 cents)
« Last Edit: April 25, 2014, 03:05:02 AM by samdavo »