Re: Creating a sphere (Object Graphics) [message #23595] |
Mon, 29 January 2001 11:58  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.14df5c245842077c989d45@news.frii.com...
> Jason P. Meyers (jpm7934@cis.rit.edu) writes:
>
>> [snip]
>> I was a bit surprised to find that IDL doesn't have a 3-D sphere
>> function/procedure up its sleeve. Nor could I find one at Eric
>> Deutsch's IDL web search
>> [snip]
>
> Well, I'm sure this was a useful exercise in
> and of itself. But I think I might have had
> a look at the ORB object that comes in the
> IDL examples/objects sub-directory. :-)
>
> sphere = Obj_New('Orb')
Also look at the MESH_OBJ procedure. It helps you create a wide variety of
solids of revolution, extrusions, etc. MESH_OBJ creates vertex &
connectivity arrays with which you can then construct an IDLgrPolygon or
IDLgrPolyline.
---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
>>
>> Anyway, I came up with the procedure listed below which produces 2-D x,
>> y, and z arrays which display a sphere. My problem is that while this
>> works for the most part, I can still see some seems and other
>> "imperfections" when I rotate the surface in Dave's program.
>> ( http://www.astro.washington.edu/deutsch/idl/htmlhelp/index.h tml). Does
>> anyone know of a better way (or minor improvement) of making a "better
>> looking" sphere. I don't want to spend too much more time on this part
>> of my project. But if I could have a cool shining sphere, that would be
>> nice.
>>
>> Thanks in advance for any and all suggestions,
>
>
> There are other goodies in that directory as well.
> RSI has a history of supplying some fabulous,
> undocumented code. It's a fair amount of work
> to wade through it, but the effort usually pays
> off.
>
> In any case, you ought to have a look through
> this directory fairly soon after you start working
> with objects.
>
> Cheers,
>
> David
>
> P.S. Let's just say spending many needless hours
> writing IDL programs was *exactly* how I became
> knowledgeable about IDL. :-)
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438 E-Mail: davidf@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Creating a sphere (Object Graphics) [message #23598 is a reply to message #23595] |
Mon, 29 January 2001 12:04  |
Jason P. Meyers
Messages: 24 Registered: September 2000
|
Junior Member |
|
|
David Fanning wrote:
>
>
> Well, I'm sure this was a useful exercise in
> and of itself. But I think I might have had
> a look at the ORB object that comes in the
> IDL examples/objects sub-directory. :-)
>
> sphere = Obj_New('Orb')
>
Thanks, this is exactly the kind of thing I was looking for.
>
> In any case, you ought to have a look through
> this directory fairly soon after you start working
> with objects.
>
Next on my list of things to do...
> Cheers,
>
> David
>
> P.S. Let's just say spending many needless hours
> writing IDL programs was *exactly* how I became
> knowledgeable about IDL. :-)
>
The time spent was worth it and I can still use cone function that
fell out of the work. :)
Once again, thanks for pointing out the
not-so-obvious-yet-should-have-been-obvious
solution.
Jason Meyers
PhD Student, Center for Imaging Science
Rochester Institute of Technology
jpm7934@rit.edu
|
|
|
Re: Creating a sphere (Object Graphics) [message #23602 is a reply to message #23595] |
Mon, 29 January 2001 10:05  |
Jason P. Meyers
Messages: 24 Registered: September 2000
|
Junior Member |
|
|
OK, I hate editors that don't warn you about breaking long lines. The
following
lines should all be a single line in the IDL procedure. Most are just
comment lines, but two are actual lines of code.
Sorry for any confusions this may have caused!
Jason
"Jason P. Meyers" wrote:
>
>
> PRO JPM_Make_Sphere, n, x=x, y=y, z=z
>
The following pairs of lines should have been left together as one
> ; Parameter: n : array width (must be odd, but we'll make it odd if
> it's not)
> ; Keywords: x,y,z : named variables to contain the 2-D arrays (n x
> 2n-1)
> ; Tweeking the value of m adjusts the spacing of points along the
> z-profile.
> x1 = cos(atan(yy,xx))*(sqrt(abs(1-(1-abs(xx))^m)) >
> sqrt(abs(1-(1-abs(yy))^m)))
> y1 = sin(atan(yy,xx))*(sqrt(abs(1-(1-abs(xx))^m)) >
> sqrt(abs(1-(1-abs(yy))^m)))
|
|
|
Re: Creating a sphere (Object Graphics) [message #23604 is a reply to message #23602] |
Mon, 29 January 2001 09:54  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Jason P. Meyers (jpm7934@cis.rit.edu) writes:
> I have recently taken a plunge into object graphics. (I think my head
> is still above water but I dunno for sure!) I spent many hours last
> night trying to create a "simple" (hah!) spherical surface and display
> it using Dave's FSC_Surface program. (Dave's program was worth its
> weight in Gold, Oops electrons don't weight much do they?)
>
> Anyway, I came up with the procedure listed below which produces 2-D x,
> y, and z arrays which display a sphere. My problem is that while this
> works for the most part, I can still see some seems and other
> "imperfections" when I rotate the surface in Dave's program.
>
> I was a bit surprised to find that IDL doesn't have a 3-D sphere
> function/procedure up its sleeve. Nor could I find one at Eric
> Deutsch's IDL web search
> ( http://www.astro.washington.edu/deutsch/idl/htmlhelp/index.h tml). Does
> anyone know of a better way (or minor improvement) of making a "better
> looking" sphere. I don't want to spend too much more time on this part
> of my project. But if I could have a cool shining sphere, that would be
> nice.
>
> Thanks in advance for any and all suggestions,
Well, I'm sure this was a useful exercise in
and of itself. But I think I might have had
a look at the ORB object that comes in the
IDL examples/objects sub-directory. :-)
sphere = Obj_New('Orb')
There are other goodies in that directory as well.
RSI has a history of supplying some fabulous,
undocumented code. It's a fair amount of work
to wade through it, but the effort usually pays
off.
In any case, you ought to have a look through
this directory fairly soon after you start working
with objects.
Cheers,
David
P.S. Let's just say spending many needless hours
writing IDL programs was *exactly* how I became
knowledgeable about IDL. :-)
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|