|
Re: Elevation Shading in Object Graphics [message #13337 is a reply to message #13334] |
Tue, 10 November 1998 00:00  |
mirko_vukovic
Messages: 50 Registered: January 1998
|
Member |
|
|
In article <MPG.10b0d2b6168b85c198970d@news.frii.com>,
davidf@dfanning.com (David Fanning) wrote:
> Mirko Vukovic (mirko_vukovic@notes.mrc.sony.com) writes:
>
>> Is it me, or the direct graphics plot in David's examples
>> looks much better than the object graphics. Could some additional
>> keyword produce a better result?
>>
>> This is just a bit of teasing from someone that did not venture into
>> object grahpics as yet.
>
> Teasing or not, I do notice a difference. I can actually
> get the solid shaded surface to look a lot better (more like
> direct graphics) if I turn shading OFF and use a Texture Map
> (an image object draped onto the surface) made from an image
> that is very much larger than the actual data. The relevant
> code might look like this:
>
> thisPalette=Obj_New('IDLgrPalette')
> thisPalette->LoadCT, 5
> s = Size(data, /Dimensions)
> bigImage = BytScl(Rebin(data, s[0]*10, s[1]*10))
> thisImage = OBJ_NEW('IDLgrImage', bigImage, Palette=thisPalette)
> thisSurface = OBJ_NEW('IDLgrSurface', data, x, y, Style=2, $
> Shading=0, Texture_Map=thisImage)
>
> The only reason I don't like this is that it doesn't
> shade the wire frame surface, just the solid surface.
>
> But, perhaps, another reason to write my own Shade
> object that uses direct graphics to display shaded
> surfaces. :-)
>
> Cheers,
>
> David
>
:-)
Actually, that is what I did (although something you wrote once triggered it)
for 2D data.
I have this PlotW object. It remembers all the data passed to it, as well as
the line styles, colors, etc. Thus it can re-draw itself, store in memory,
whatever, even print itself (in that case it can change colors to linetypes
and such).
Still rough, but a great replacement for IDL's plot. Actually, as I wrote
it, I started seing a ``reason d'etre'' for object graphics, as some OG would
nicely plop into this application (like legends).
The user interface sucks, but I just don't have the time to finish it up.
Mirko
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
|
|
|
Re: Elevation Shading in Object Graphics [message #13341 is a reply to message #13334] |
Mon, 09 November 1998 00:00  |
Struan Gray
Messages: 178 Registered: December 1995
|
Senior Member |
|
|
David Fanning, davidf@dfanning.com writes:
> The only reason I don't like this is that it doesn't
> shade the wire frame surface, just the solid surface.
This is my current main whinge about object graphics, which, as I
dig deeper, increasingly betrays a bias towards solids modelling at
the expense of other easily-implemented applications. For all the
reasons outlined in my surface plotting pages I would like to be able
to specify independent colours for ploygon edges and fills when
plotting surfaces. It would also be nice to be able to specify an
object model as a linestyle, just as you can plot a polyline with an
object model used as a symbol at each vertex.
Just dreaming
Struan
|
|
|
Re: Elevation Shading in Object Graphics [message #13346 is a reply to message #13341] |
Mon, 09 November 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Mirko Vukovic (mirko_vukovic@notes.mrc.sony.com) writes:
> Is it me, or the direct graphics plot in David's examples
> looks much better than the object graphics. Could some additional
> keyword produce a better result?
>
> This is just a bit of teasing from someone that did not venture into
> object grahpics as yet.
Teasing or not, I do notice a difference. I can actually
get the solid shaded surface to look a lot better (more like
direct graphics) if I turn shading OFF and use a Texture Map
(an image object draped onto the surface) made from an image
that is very much larger than the actual data. The relevant
code might look like this:
thisPalette=Obj_New('IDLgrPalette')
thisPalette->LoadCT, 5
s = Size(data, /Dimensions)
bigImage = BytScl(Rebin(data, s[0]*10, s[1]*10))
thisImage = OBJ_NEW('IDLgrImage', bigImage, Palette=thisPalette)
thisSurface = OBJ_NEW('IDLgrSurface', data, x, y, Style=2, $
Shading=0, Texture_Map=thisImage)
The only reason I don't like this is that it doesn't
shade the wire frame surface, just the solid surface.
But, perhaps, another reason to write my own Shade
object that uses direct graphics to display shaded
surfaces. :-)
Cheers,
David
----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: Elevation Shading in Object Graphics [message #13347 is a reply to message #13341] |
Mon, 09 November 1998 00:00  |
mirko_vukovic
Messages: 50 Registered: January 1998
|
Member |
|
|
In article <MPG.10af776d8c8c3df098970a@news.frii.com>,
davidf@dfanning.com (David Fanning) wrote:
> Hi Folks,
>
> Well, naturally, I hadn't posted my "Elevation Shading in
> Object Graphics" example on my web page for more than 10
> minutes when people more knowledgeable than I starting
> pointing out the obvious faults.
>
> In particular (and it is exceedingly odd that neither I
> nor the folks who were helping me at RSI noticed this) it
> is a LOT better to turn shading ON, although it is still
> true that you want to have lights OFF.
>
> I also discovered that it is better to add a color palette
> to the surface (thanks to Struan) than to the window, which
> I was doing previously. (Actually, it works the same, it
> just seems more natural and elegant to add it to the
> surface, where it really belongs.)
>
> Anyway, I think I have it sorted out now and you can view
> the article and code at these URLs:
>
> http://www.dfanning.com/tips/elevation_object.html
> http://www.dfanning.com/programs/object_shade_surf.pro
>
> As always, a big thanks to the anonymous lurkers who
> keep me on the straight and narrow. :-)
>
> Cheers,
>
> David
>
> ----------------------------------------------------------
> David Fanning, Ph.D.
> Fanning Software Consulting
> E-Mail: davidf@dfanning.com
> Phone: 970-221-0438, Toll-Free Book Orders: 1-888-461-0155
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
Is it me, or the direct graphics plot in David's examples
looks much better than the object graphics. Could some additional
keyword produce a better result?
This is just a bit of teasing from someone that did not venture into
object grahpics as yet.
mirko
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
|
|
|