Re: graphics formats, triangulisation & coordinate systems [message #36221] |
Thu, 28 August 2003 11:44  |
nasalmon
Messages: 33 Registered: August 2003
|
Member |
|
|
"Rick Towler" <rtowler@u.washington.edu> wrote in message news:<bijb5t$27n4$1@nntp6.u.washington.edu>...
> "Neil" wrote in message ...
>
>> 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.
>
> This really isn't a conversion, you simply need to read the .3ds files and
> extract the relevant data. The other day I almost wrote a .dlm for IDL that
> would read .3ds files but although that exercise would have been fun I
> couldn't justify the time. Instead I used a utility to dump .3ds files to
> ASCII. Google for "3dsrdr.c".
>
> Another option is to use the freeware 3d modeling package OpenFX to read
> your .3ds files and export them as .dxf. IDL can read .dxf files.
>
>
>> 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.
>
>
>> 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.
>
> You don't need to make these decisions as the people who wrote openGL and
> IDL did it for you. Right handed, positive Z pointing towards the viewer,
> positive rotation is counter-clockwise.
>
> -Rick
Rick,
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?
Isnt there a routine in IDL called "tessellation" that i can use to
triangulise polygons of an object?
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.
I really want a code which is compatable with other formats as
possible. 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.
I am convinced RH coordinate is probably best, but which direction
should be best for the z-axis?
Thank you again for you comments.
Neil
|
|
|