Loading Dgn files

New Message Reply Date view Thread view Subject view Author view

Kim Michael Fairchild (fair++at++iss.nus.sg)
Fri, 25 Mar 94 17:00:03+080


Hi,

We have recently started using Performer 1.1 and are porting over code
from our existing internally developed toolkit.

Much of the existing tools were developed for dealing with
"Intergraph" format "dgn" files. (Translation from dgn to performer is
a two-step process, first we translate from a very complicated binary
format from dgn to an ascii version and then we load the ascii to
performer).

We have constructed a "loadDgn" using the examples, which seems to
work reasonable well. We have several questions however.

1) Dgn files typically have lots of "shapes". The easiest thing to do
is to create a new geometry and node for each of these. We get a bunch
of geometries with pfGSetNumPrims set to 1. It seems that this
approach creates lots and lots of nodes; in our first tests it seemed
we have poor performance on such datasets.

One solution would be to collect the shapes of the different types
(quads, or triangles) and then create a single geometry; however this
is quite messy (and a LOT more work). Also culling won't work as nice
if the orginally shapes were far apart. So what is the best approach?

2) What happens if you don't set a pfGeoState for a pfGeoSet? Does it
inherit the global state?

3) This is the embarrassing one. We have lots of polygons that have
greater that 4 vertices. Before we easily used gl to draw them. Now
given drawing primitives that have < 5 vertices, do we have to
decompose them into smaller polygons or are we missing something? If
we have to decompose them, how do we do it?

thanks much,

Kim.

PS By the way, we have a lovely translator for taking dgn design files
and turning them into polygons (at selectable resolutions). Is any one
else doing the same? Here is a data file fragment of the output of the
translator. We will convert it to binary in the future (always nice to
debug in ascii :->).

format: bgf
shape {
   material {
      ambient: 1.000000 1.000000 1.000000
      diffuse: 0.000000 0.777778 0.744444
      emission: 0.000000 0.000000 0.000000
      specular: 0.000000 0.000000 0.000000
      shininess: 0.000000
      transparency: 0.000000
   }
   no of polygons: 4
   polygon {
      layer: 255
      type: 4
      no of points: 3
      vertex {
      0.041743 0.049698 -0.048695
      -0.005608 0.049698 -0.048695
      0.018067 0.026023 -0.022703
      }
      normal {
      0.000000 0.739274 0.673405
      0.000000 0.739274 0.673405
      0.000000 0.739274 0.673405
      }
   }
   polygon {
      layer: 255


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:13 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.