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

Home » Public Forums » archive » Re: draw spheres in 3D space
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: draw spheres in 3D space [message #76497 is a reply to message #76496] Mon, 06 June 2011 12:31 Go to previous messageGo to previous message
Junum is currently offline  Junum
Messages: 13
Registered: May 2010
Junior Member
On Jun 6, 2:21 pm, Michael Galloy <mgal...@gmail.com> wrote:
> On 6/6/11 1:14 PM, Junum wrote:
>
>
>
>
>
>> On Jun 6, 2:03 pm, Paulo Penteado<pp.pente...@gmail.com>  wrote:
>>> On Jun 6, 3:53 pm, Junum<junshi...@gmail.com>  wrote:
>
>>>> On Jun 6, 1:50 pm, Junum<junshi...@gmail.com>  wrote:
>
>>>> > Hello,
>
>>>> > I wan to know how to draw spheres in 3D space with xyz axes.
>>>> > For example, I have 7 spheres with radius of 1 and its center is at
>>>> > (0,0,0)
>>>> > (2,0,0)
>>>> > (-2,0,0)
>>>> > (0,2,0)
>>>> > (0,-2,0)
>>>> > (0,0,2)
>>>> > (0,0,-1).
>>>> > Since I don't have idea for 3D drawing, it is hard to start.
>>>> > Could you let me know any clue, help, suggestion?
>>>> > Thank you very much.
>
>>>> > Sincerely,
>>>> > Jun
>
>>>> There was a typo.
>>>> A center of the last sphere should be (0,0,-2).
>
>>>> Jun
>
>>> xyz=[[0,0,0],[2,0,0],[-2,0,0],[0,2,0],[0,-2,0],[0,0,2],[0,0, -2]]
>>> p=plot3d(xyz[0,*],xyz[1,*],xyz[2,*],sym_object=orb(),/
>>> undocumented,linestyle='none')
>
>> Thank you for suggestion, but I got error message,
>
>> IDL>  xyz=[[0,0,0],[2,0,0],[-2,0,0],[0,2,0],[0,-2,0],[0,0,2],[0, 0,-2]]
>> IDL>  p=plot3d(xyz[0,*],xyz[1,*],xyz[2,*],sym_object=orb(),/
>> undocumented,linestyle='none')
>
>> p=plot3d(xyz[0,*],xyz[1,*],xyz[2,*],sym_object=orb(),/
>> undocumented,linestyle='none')
>>                                                 ^
>> % Syntax error.
>
>> I am using IDL 7.0.
>
> This should work on older versions of IDL:
>
> model = obj_new('IDLgrModel')
> model->add, obj_new('orb', pos=[ 0, 0, 0], radius=1., color=[255, 215, 0])
> model->add, obj_new('orb', pos=[ 2, 0, 0], radius=1., color=[255, 215, 0])
> model->add, obj_new('orb', pos=[-2, 0, 0], radius=1., color=[255, 215, 0])
> model->add, obj_new('orb', pos=[ 0, 2, 0], radius=1., color=[255, 215, 0])
> model->add, obj_new('orb', pos=[ 0,-2, 0], radius=1., color=[255, 215, 0])
> model->add, obj_new('orb', pos=[ 0, 0, 2], radius=1., color=[255, 215, 0])
> model->add, obj_new('orb', pos=[ 0, 0,-2], radius=1., color=[255, 215, 0])
>
> xobjview, model
>
> Mike
> --
> Michael Galloywww.michaelgalloy.com
> Modern IDL, A Guide to Learning IDL:http://modernidl.idldev.com
> Research Mathematician
> Tech-X Corporation

Thank you very much for help.
It is really cool.
How can I add xyz axes on this plot?
Thank you.

Jun
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Automated plotting for website?
Next Topic: Major ticks is exceeds the plotting window

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

Current Time: Sat Oct 11 11:53:34 PDT 2025

Total time taken to generate the page: 0.40266 seconds