On May 24, 11:38 am, David Fanning <n...@dfanning.com> wrote:
> Folks,
>
> Alright, suppose this.
>
> Suppose I wanted to build a 3D transparent globe, with
> continental outlines, major cities, etc. displayed on it.
> And suppose I wanted to stick a sphere in the center of
> the globe with pointy bits sticking out of it. (Think of
> of those medieval weapons that the Visigoths swung from a chain to
> bash in the skulls of their enemies.) I'd like to see where the
> pointy bits stick out of the globe. (Please don't ask
> me why.)
>
> Would IDL be the software you would use to do this?
> Would I run into the "pimento problem" with the back
> side of the globe?
How about:
interiorSphere = obj_new('orb', radius=0.1, $
alpha_channel=0.5, $
color=[255, 0, 0])
globe = obj_new('orb', radius=0.2, $
alpha_channel=0.2, $
color=[0, 0, 255])
vertices1 = [[0, 0, 0], [0, 0, 0.1], [0.3, 0, 0]]
polygons1 = [3, 0, 1, 2]
spike1 = obj_new('idlgrpolygon', vertices1, $
polygons=polygons1, $
alpha_channel=0.5, $
color=[0, 255, 0])
vertices2 = [[0, 0, 0], [0, 0, 0.1], [0.212, 0.212, 0]]
polygons2 = [3, 0, 1, 2]
spike2 = obj_new('idlgrpolygon', vertices2, $
polygons=polygons2, $
alpha_channel=0.5, $
color=[0, 255, 0])
omodel = obj_new('idlgrmodel')
omodel->add, interiorSphere
omodel->add, spike1
omodel->add, spike2
omodel->add, globe
xobjview, omodel
I think if "globe" where the only transparent object it would be
pretty good.
By the way, I've been impressed with VTK. For something similar to
your problem, how about these two shots:
http://michaelgalloy.com/wp-content/uploads/2007/05/vtk-left .png
http://michaelgalloy.com/wp-content/uploads/2007/05/vtk-righ t.png
These are screenshots from an interactive trackball-type application
and I'm not doing any manual sorting of polygons. (Yes, POV-Ray is
awesome, but it takes me a while to everything setup just right and
it's definitely not interactive.)
Mike
--
michaelgalloy.com
|