comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Some questions on cgsurf and cgsurface
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Some questions on cgsurf and cgsurface [message #76960] Wed, 20 July 2011 19:16
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
That is very helpful. Thanks.

On Jul 20, 11:00 pm, David Fanning <n...@dfanning.com> wrote:
> David Fanning writes:
>>> I have been trying to make shaded surfaces with CG, and encountered a
>>> few difficulties, which perhaps have obvious solutions for those who
>>> can find their way around the CG routines:
>
>>> I tried to follow the examples with
>
>>> data=dist(200)
>>> loadct,33
>>> cgwindow,'cgsurf',data,/shaded
>>> cgcontrol,create_ps='cgtest.ps'
>
>>> Which results in a file with a red background. The same if using the
>>> menu in the window.
>
>> Yes, this is because shaded surfaces are really
>> images with axes overlayed on them. To get a white
>> background, you will have to do something like this:
>
>> data=dist(200)
>> loadct,33, ncolors=254
>> set_shading, values=[0,254]
>> tvlct, 255, 255, 255, 255
>> cgwindow,'cgsurf',data,/shaded
>> cgcontrol,create_ps='cgtest.ps'
>
> I woke up at 4AM for some reason, so I decided to fix this
> problem before I jumped on the plane. The cgSurf program
> now produces correct PostScript output in the original
> way Paulo called the program. You can find the updated
> program here:
>
>   http://www.idlcoyote.com/programs/cgsurf.pro
>
> Testing revealed a couple of problems with the Z-graphics
> buffer and other Coyote Graphics programs, which I also
> fixed.
>
>   http://www.idlcoyote.com/programs/cgdefcharsize.pro
>   http://www.idlcoyote.com/programs/cgquery.pro
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thue. ("Perhaps thos speakest truth.")
Re: Some questions on cgsurf and cgsurface [message #76961 is a reply to message #76960] Wed, 20 July 2011 19:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>> I have been trying to make shaded surfaces with CG, and encountered a
>> few difficulties, which perhaps have obvious solutions for those who
>> can find their way around the CG routines:
>>
>> I tried to follow the examples with
>>
>> data=dist(200)
>> loadct,33
>> cgwindow,'cgsurf',data,/shaded
>> cgcontrol,create_ps='cgtest.ps'
>>
>> Which results in a file with a red background. The same if using the
>> menu in the window.
>
> Yes, this is because shaded surfaces are really
> images with axes overlayed on them. To get a white
> background, you will have to do something like this:
>
> data=dist(200)
> loadct,33, ncolors=254
> set_shading, values=[0,254]
> tvlct, 255, 255, 255, 255
> cgwindow,'cgsurf',data,/shaded
> cgcontrol,create_ps='cgtest.ps'

I woke up at 4AM for some reason, so I decided to fix this
problem before I jumped on the plane. The cgSurf program
now produces correct PostScript output in the original
way Paulo called the program. You can find the updated
program here:

http://www.idlcoyote.com/programs/cgsurf.pro

Testing revealed a couple of problems with the Z-graphics
buffer and other Coyote Graphics programs, which I also
fixed.

http://www.idlcoyote.com/programs/cgdefcharsize.pro
http://www.idlcoyote.com/programs/cgquery.pro

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
Re: Some questions on cgsurf and cgsurface [message #76964 is a reply to message #76961] Wed, 20 July 2011 14:09 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
Ok, thanks for the help.

On Jul 20, 5:13 pm, David Fanning <n...@dfanning.com> wrote:
> Paulo Penteado writes:
>> I have been trying to make shaded surfaces with CG, and encountered a
>> few difficulties, which perhaps have obvious solutions for those who
>> can find their way around the CG routines:
>
>> I tried to follow the examples with
>
>> data=dist(200)
>> loadct,33
>> cgwindow,'cgsurf',data,/shaded
>> cgcontrol,create_ps='cgtest.ps'
>
>> Which results in a file with a red background. The same if using the
>> menu in the window.
>
> Yes, this is because shaded surfaces are really
> images with axes overlayed on them. To get a white
> background, you will have to do something like this:
>
> data=dist(200)
> loadct,33, ncolors=254
> set_shading, values=[0,254]
> tvlct, 255, 255, 255, 255
> cgwindow,'cgsurf',data,/shaded
> cgcontrol,create_ps='cgtest.ps'
>
>> Also, am I correct in thinking that all ps output is only bitmap? It
>> is what it looked like from what I saw in the code.
>
> A shaded surface is a bitmap, because what is returned
> from SHADE_SURF is an image. Most other graphic output
> is vectorized.
>
>> Then I tried cgsurface:
>
>> data=dist(200)
>> loadct,33
>> cgsurface,data,/shaded
>
>> Which does make a much nicer looking ps file, which also matches what
>> I see in the screen. But I could not find a way to programmatically
>> make the file. And it also seems to only make bitmaps, at a fixed
>> resolution.
>
> Yes, there is no current way to create a PostScript file
> programmatically. And, to make things easy, the
> resolution is set to the window size. I am not sure
> if this can be vectorized, and I can't research it right
> now, as I am getting ready to leave Africa in a few hours.
>
> I'm planning a report on the lion roaring outside my
> hut, just 15 feet from my unlock screened door, and
> the cheetah I saw in the wild! :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thue. ("Perhaps thos speakest truth.")
Re: Some questions on cgsurf and cgsurface [message #76968 is a reply to message #76964] Wed, 20 July 2011 13:13 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paulo Penteado writes:

> I have been trying to make shaded surfaces with CG, and encountered a
> few difficulties, which perhaps have obvious solutions for those who
> can find their way around the CG routines:
>
> I tried to follow the examples with
>
> data=dist(200)
> loadct,33
> cgwindow,'cgsurf',data,/shaded
> cgcontrol,create_ps='cgtest.ps'
>
> Which results in a file with a red background. The same if using the
> menu in the window.

Yes, this is because shaded surfaces are really
images with axes overlayed on them. To get a white
background, you will have to do something like this:

data=dist(200)
loadct,33, ncolors=254
set_shading, values=[0,254]
tvlct, 255, 255, 255, 255
cgwindow,'cgsurf',data,/shaded
cgcontrol,create_ps='cgtest.ps'

> Also, am I correct in thinking that all ps output is only bitmap? It
> is what it looked like from what I saw in the code.

A shaded surface is a bitmap, because what is returned
from SHADE_SURF is an image. Most other graphic output
is vectorized.

> Then I tried cgsurface:
>
> data=dist(200)
> loadct,33
> cgsurface,data,/shaded
>
> Which does make a much nicer looking ps file, which also matches what
> I see in the screen. But I could not find a way to programmatically
> make the file. And it also seems to only make bitmaps, at a fixed
> resolution.

Yes, there is no current way to create a PostScript file
programmatically. And, to make things easy, the
resolution is set to the window size. I am not sure
if this can be vectorized, and I can't research it right
now, as I am getting ready to leave Africa in a few hours.

I'm planning a report on the lion roaring outside my
hut, just 15 feet from my unlock screened door, and
the cheetah I saw in the wild! :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL runtime and X window
Next Topic: Loading Sorted Images into a 3D array

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:28:47 PDT 2025

Total time taken to generate the page: 0.00656 seconds