Re: Plotting 3D spheres [message #46308] |
Fri, 18 November 2005 17:18 |
snfinder@naver.com
Messages: 35 Registered: August 2005
|
Member |
|
|
Wow~ Wonderful~~ ^^
Thanks a THOUSAND MILLION BILLION~~~""Rick Towler"" ~~ ^________^
OBJ? Wow~ I didn't know that there is beautiful method~
Um.. I have to get down to study that subject .
OK~
Thanks a lot again~ Rick
I love this group. It gives me very~~ big helps.
Park
|
|
|
Re: Plotting 3D spheres [message #46311 is a reply to message #46308] |
Fri, 18 November 2005 08:33  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
pro plot_sphere
nOrbs = 20
s = systime(/seconds)
c = randomu(s, 3, nOrbs) * 2.
r = randomu(s, nOrbs)
orbArray = objarr(nOrbs)
for n=0, nOrbs-1 do $
orbArray[n] = OBJ_NEW('orb', POS=c[*,n], RADIUS=r[n], $
COLOR=randomu(s,3)*255, STYLE=2)
oModel = OBJ_NEW('IDLgrModel')
oModel -> Add, orbArray
xobjview, oModel, /BLOCK
obj_destroy, oModel
end
You'll find the source for orb__define.pro in $IDL_DIR\examples\visual.
The docs are in the header. You may want to play around with the
DENSITY keyword depending on the # of spheres you need to plot and your
hardware.
-Rick
PYJ wrote:
> Dear all,
>
> Hi~!
> I have a lot of spheres(3D positions of centers and radius).
> XC,YC,ZC,RADIUS: these are arrays.
> I want to express these spheres on 3D space.
> Maybe, many spheres overlap each other. I don't care this.
> Actually, I hope to plot some irregular shape by overlapping many
> spheres.
> Color shading is better.
>
> I have studied the example of procedure "shade_volume" a little. But I
> can't overlap spheres.
>
> How can I do it?
>
> Thank you~(^_^)
>
>
> (I love IDL! ^___^)
>
|
|
|
Re: Plotting 3D spheres [message #46318 is a reply to message #46311] |
Fri, 18 November 2005 00:43  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
PYJ writes:
> I have a lot of spheres(3D positions of centers and radius).
> XC,YC,ZC,RADIUS: these are arrays.
> I want to express these spheres on 3D space.
> Maybe, many spheres overlap each other. I don't care this.
> Actually, I hope to plot some irregular shape by overlapping many
> spheres.
> Color shading is better.
>
> I have studied the example of procedure "shade_volume" a little. But I
> can't overlap spheres.
>
> How can I do it?
In twenty-five words, or less, please. ;-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|