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

Home » Public Forums » archive » Re: 3d sphere revisited
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: 3d sphere revisited [message #33459] Tue, 31 December 2002 09:39
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"paul wisehart" <paul_wisehart@ssaihq.com> wrote


>> "Overplotting" the sphere. Create additional IDLgrPolyon or
IDLgrPolyline
>> objects with verticies whose radius values are slightly larger than your
>> sphere such that they appear to float on the surface of the sphere. An
>> example would be creating an IDLgrPolygon object of the continents. You
>> could add IDLgrPolyline objects representing rivers, roads, borders....
Use
>> shape and .dxf files to get this data into IDL.
>
> THAT is exactly what I would like to do. Can you elaborate on how
> i could set up these IDLgrPolygon 'continents'?
> Or, maybe theres an example program I could look at?

I remember bringing this up in an earlier post of yours. You may want to go
back and see what I had to say. Basically you'll use CV_COORD to convert
spherical coordinates to rectangular coordinates which you can plot in OG.
Assuming you have a "flat" sphere, just set the radius value a wee bit
larger than your underlying sphere to get your objects to "float" on your
sphere. If you have added relief it gets trickier but can be done.

The texture on your sphere will be underneath your polygon objects which may
or may not be what you are looking for.


I mentioned .dxf and shape files since these are two relatively easy methods
to get complex geometry and connectivity data into IDL. I haven't worked
with shape files but I have imported .dxf files into IDL. It takes a bit of
work to get at the individual elements in the file so you can change their
properties but some of that is just learning how .dxf files work. Check out
XDXF.PRO and GET_DXF_OBJECTS.PRO.

I am sending a .dxf file of the continents to you directly. To get
something going right away you can use GET_DXF_OBJECTS() and xobjview.

model=GET_DXF_OBJECTS('continents.dxf')
xobjview, model

Be aware that the actual data coordinates will probably be *way* off so you
will need to scale either the continents or your sphere to get the desired
effect. To get at the actual IDLgrPolygon objects, use the GET method of
the IDLgrModel returned by GET_DXF_OBJECTS (there seems to be only one in
this case).


-Rick
Re: 3d sphere revisited [message #33460 is a reply to message #33459] Tue, 31 December 2002 06:36 Go to previous message
paul wisehart is currently offline  paul wisehart
Messages: 28
Registered: December 2002
Junior Member
THanks for the replies.

> I should think the texture map is the data!

This clears it up a little for me.
I was looking at the issue a little skewed i guess.


Rick,


> "Overplotting" the sphere. Create additional IDLgrPolyon or IDLgrPolyline
> objects with verticies whose radius values are slightly larger than your
> sphere such that they appear to float on the surface of the sphere. An
> example would be creating an IDLgrPolygon object of the continents. You
> could add IDLgrPolyline objects representing rivers, roads, borders.... Use
> shape and .dxf files to get this data into IDL.

THAT is exactly what I would like to do. Can you elaborate on how
i could set up these IDLgrPolygon 'continents'?
Or, maybe theres an example program I could look at?

I've tried IDLgrPolyline objects on a sphere, and I don't
understand how the coordinates relate to the sphere's coordinates.
For example:
My IDLgrPolyline would draw 'thru' the sphere. How do
I draw an IDLgrPolyline( or IDLgrPolygon ) to match the sphere's
curved surface??

happy new year,
(...its today right?)
paul wisehart
Re: 3d sphere revisited [message #33461 is a reply to message #33460] Mon, 30 December 2002 10:28 Go to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"paul wisehart" <paul_wisehart@ssaihq.com> wrote


> Should/Can I be plot data to the sphere directly?

To continue David's thought the sphere *is* the data so I suppose you are
already doing this ;)


> OR, should i just plot the data to the texture image
> and then re-apply the texture?

I see three ways of presenting information with your sphere:

Modifying the sphere verticies. An example would be adding relief to your
sphere to depict the variations in elevation of a planet. There is an
example of this in the "What's new in 5.5" .pdf.

"Overplotting" the sphere. Create additional IDLgrPolyon or IDLgrPolyline
objects with verticies whose radius values are slightly larger than your
sphere such that they appear to float on the surface of the sphere. An
example would be creating an IDLgrPolygon object of the continents. You
could add IDLgrPolyline objects representing rivers, roads, borders.... Use
shape and .dxf files to get this data into IDL.

Texturing. The more textures the merrier. You can add layer after layer of
data by taking a series of bitmaps and combining them into a single texture.
There are many ways you can combine the data but a place to start would be
with the blending function used by IDLgrImage (see help on
IDLgrImage::Init).

Determining the mix of approaches will depend on what you have and want to
say.

-Rick
Re: 3d sphere revisited [message #33462 is a reply to message #33461] Mon, 30 December 2002 09:32 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
paul wisehart (paul_wisehart@ssaihq.com) writes:

> Now, I CAN plot a sphere, as an object. And, I CAN, put
> a texture map on the sphere.
>
> I CANNOT plot any data to the sphere.
> My question:
>
> Should/Can I be plot data to the sphere directly?
>
> OR, should i just plot the data to the texture image
> and then re-apply the texture?

I should think the texture map *is* the data! And since
it is an image, you can be as elaborate as you like
when setting it up (e.g., you can use alpha channel
blending, etc., etc.).

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 3d sphere revisited
Next Topic: Re: Issue Installing IDL 5.6 under Mac OS 10.2.3

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

Current Time: Sat Oct 11 16:24:38 PDT 2025

Total time taken to generate the page: 1.20194 seconds