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

Home » Public Forums » archive » graphics formats, triangulisation & coordinate systems
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
graphics formats, triangulisation & coordinate systems [message #36252] Wed, 27 August 2003 13:07 Go to next message
nasalmon is currently offline  nasalmon
Messages: 33
Registered: August 2003
Member
Does anyone know how i can convert files in the 3DS format into the
OBJ format, or have a code that can do this. This are many object in
3DS format but i want to manipulate verticies and polygons, so i need
to access the raw data.

I also need to convert all polygons to triangles, is there a simple
triangulisation code i can use. I work in IDL so could this code be
used in the conversion. To take care of reflections i need to ensure
all surface are plane by definition, so i would like to convert all
otherwise polygons to triangles

Which is the best coordinate system to operate in for computer
graphics, right-handed or left-handed. I am inclinded to use a
right-hand coord system as most maths books use this.

Also if i chose a particular system should i chose the z-coordinate as
away (towards) the viewer or up (down). In know it is simple to
convert, but i just want to use the same conventions as the majority
of users.

Many thanks,

Neil
Re: graphics formats, triangulisation & coordinate systems [message #36298 is a reply to message #36252] Fri, 29 August 2003 12:41 Go to previous message
nasalmon is currently offline  nasalmon
Messages: 33
Registered: August 2003
Member
"Rick Towler" <rtowler@u.washington.edu> wrote in message news:<bim3ko$20ue$1@nntp6.u.washington.edu>...
> "Neil" wrote in message ...
>> "Rick Towler" wrote in message >...
>>> "Neil" wrote in message ...
>
>>>> I also need to convert all polygons to triangles, is there a simple
>>>> triangulisation code i can use. I work in IDL so could this code be
>>>> used in the conversion. To take care of reflections i need to ensure
>>>> all surface are plane by definition, so i would like to convert all
>>>> otherwise polygons to triangles
>>>
>>> What polygons? How are they defined? If they are the polygons
> contained in
>>> your .3ds files then they are already defined as a collection of
> triangles
>>> by the vertices and connectivity data.
>>>
>
>> many thanks for you helpful comments. As for polygons other than
>> triangles, i was wanting a code that could read files that had say
>> rectangles, pentagons, hexagons or what ever might exist out there.
>> Not being such a specialist in this area, i am not really aware of how
>> common other type of polygons are in this graphics business. However,
>> for me to deal with reflections i would prefer something that had a
>> plane surface by definition.
>
>> Are polygons in graphics always triangles?
>
> At some point, yes (more or less). It all depends on your 3d graphics API.
> I say more or less because the "popular" 3d APIs OpenGL and DirectX eat
> triangles for breakfast, lunch and dinner. (they also eat "quads" which are
> triangle pairs.) You could build your own 3d software based rendering
> system where you passed objects comprised of any type 2d polygon to your
> renderer but if you are planning on doing that in IDL you must be a
> masochist.
>
> IDL's object graphics is an object oriented interface to openGL, IDL style.
> Crack open the documentation and have a look. Ronn Kling has a book "Power
> Graphics with IDL" which is a beginners guide to object graphics and is a
> good book to have on hand. You can pick it up at his website:
> www.kilvarock.com
>
>
>> Isnt there a routine in IDL called "tessellation" that i can use to
>> triangulise polygons of an object?
>
> Yes, and this is what you would need to do if you had, say, a mesh comprised
> of octagons. But I think that a mesh like this would be pretty rare. Since
> most graphics applications are built on openGL or DirectX everthing is
> eventually decomposed into tris. Often, the earlier you do that, the
> better.
>
>
>> I also see a coordinate system being RH, but with x being towards the
>> right, y being away from the viewer and z being upwards, and in fact
>> started to right my code in that convention. Such a coordinate system
>> seems easier to visulise. However, now i'm thinking possibly i should
>> change to RH with z azis coming towards the viewer. Shouldnt be too
>> much trouble at this early stage.
>
> Regardless of any coordinate systems you devise, to display anything using
> object graphics you'll need to work with a RH coordinate system with +Z
> pointing towards the viewer. While many other coord systems exist, this is
> what has been adopted by OpenGL and IDL.
>
>
>> I really want a code which is compatable with other formats as
>> possible.
>
> Hummmmm. Don't know what you mean...
>
>
>> I was also planning on putting the orgin at the viewer's
>> position. If i do that with RH with z coming toward the viewer, all z
>> values for objects in the scene are negative. Still i suppose that
>> does not matter provided you have all your coordinate transformation
>> correct.
>
> Before you wrestle with this too much, have a look at my camera object. It
> is an "improved" viewing system for object graphics. Set it up and point it
> at your subjects. You don't have to worry so much about the technical
> details of setting up the view.
>
> http://www.acoustics.washington.edu/~towler/
>
> I have a major update that I'll be posting in the next few days (I am
> working on the docs now.) It abstracts the view even more and I *hope* it
> will be even easier to use but you can get started with the old version.
>
>
>> I am convinced RH coordinate is probably best, but which direction
>> should be best for the z-axis?
>
> Again, if you are going to be visualizing your results in IDL you'll need to
> work with a RH coordinate system with +Z pointing towards the viewer.
>
>
> All this talk of a coordinate systems and reflections.... What are you
> trying to do? Pardon my assumption but it seems that you are just getting
> starting with 3d graphics and IDL's object graphics. If so, you really
> don't need to worry about this too much. IDL/openGL handles creating
> normals, lighting and the other details. You just supply the vertices and
> connectivity (as tris or quads). Unless you are creating procedural texture
> maps or meshes I can't think of a reason to lose sleep over these things
> beyond knowing the coordinate system so you can place your objects in the
> world correctly.
>
> Good luck!
>
> -Rick


Rick,

many thanks for your very helpful comments. I am slowing understanding
all this stuff so i'll go on to develop my code for microwave imaging
where you need to calculate illumination dependent on the microwave
properties of the atmosphere and objects in the environment and where
many objects are semitransparent. You realise correctly, i am only a
novice at this but i'll use Z towards the observer in a RH system. I
can imaging when i understand IDL better and the proper use of the
graphics routines i can probably make things much more efficient.
However, before i can start to make there things more efficient i need
to understand all this from the ground up. I am also very interested
in the absolute intensities of the microwave radiation, so o/p units
will be thing like Watts/m2/steradian (ie absolute brightness). I'll
just start with simple shapes like tetrahedons and pyramids and when
i'm convinced its debugged for my environment, i'll move on to the
more sophisticated modelling of semitransparent building walls, people
and flying saucers navigating through fog.

best regards,

Neil
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: how to get the index of the maximum element in each row for a 2D matrix efficiently
Next Topic: OT: What lab notebook?

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

Current Time: Fri Oct 10 05:21:32 PDT 2025

Total time taken to generate the page: 0.87993 seconds