ReaderMESH input?

Core SceneGraph API, Utilities, Factories etc.
Post Reply
petsagouris
Posts: 8
Joined: Sun 26. Aug 2012, 14:15

ReaderMESH input?

Post by petsagouris » Mon 27. Aug 2012, 20:07

I am looking at the ReaderMESH class and I've yet to find an input file to test it.
Does anyone have something this can be tested against?

User avatar
gunn
Posts: 323
Joined: Thu 14. Dec 2006, 09:56
Location: TU Berlin
Contact:

Re: ReaderMESH input?

Post by gunn » Tue 28. Aug 2012, 09:39

The MESH type is a sub-type of the OOGL file format, which was developed at the Geometry Center in the 1990's. See http://www.geom.uiuc.edu/software/geomview/ooglman.html. jReality supports a subset of this file format, including the MESH type. This is a surface with quad-mesh connectivity. Here's an example file of a sphere containing only vertices:

Code: Select all

MESH
10 10
0 0 1
0 0 1
0 0 1
0 0 1
0 0 1
0 0 1
0 0 1
0 0 1
0 0 1
0 0 1
  
0.34202 0 0.939693
0.262003 0.219846 0.939693
0.0593912 0.336824 0.939693
-0.17101 0.296198 0.939693
-0.321394 0.116978 0.939693
-0.321394 -0.116978 0.939693
-0.17101 -0.296198 0.939693
0.0593912 -0.336824 0.939693
0.262003 -0.219846 0.939693
0.34202 -8.37708e-17 0.939693
  
0.642788 0 0.766044
0.492404 0.413176 0.766044
0.111619 0.633022 0.766044
-0.321394 0.55667 0.766044
-0.604023 0.219846 0.766044
-0.604023 -0.219846 0.766044
-0.321394 -0.55667 0.766044
0.111619 -0.633022 0.766044
0.492404 -0.413176 0.766044
0.642788 -1.57438e-16 0.766044
  
0.866025 0 0.5
0.663414 0.55667 0.5
0.150384 0.852869 0.5
-0.433013 0.75 0.5
-0.813798 0.296198 0.5
-0.813798 -0.296198 0.5
-0.433013 -0.75 0.5
0.150384 -0.852869 0.5
0.663414 -0.55667 0.5
0.866025 -2.12115e-16 0.5
  
0.984808 0 0.173648
0.754407 0.633022 0.173648
0.17101 0.969846 0.173648
-0.492404 0.852868 0.173648
-0.925417 0.336824 0.173648
-0.925417 -0.336824 0.173648
-0.492404 -0.852869 0.173648
0.17101 -0.969846 0.173648
0.754407 -0.633022 0.173648
0.984808 -2.41208e-16 0.173648
  
0.984808 0 -0.173648
0.754407 0.633022 -0.173648
0.17101 0.969846 -0.173648
-0.492404 0.852868 -0.173648
-0.925417 0.336824 -0.173648
-0.925417 -0.336824 -0.173648
-0.492404 -0.852869 -0.173648
0.17101 -0.969846 -0.173648
0.754407 -0.633022 -0.173648
0.984808 -2.41208e-16 -0.173648
  
0.866025 0 -0.5
0.663414 0.55667 -0.5
0.150384 0.852868 -0.5
-0.433013 0.75 -0.5
-0.813798 0.296198 -0.5
-0.813798 -0.296198 -0.5
-0.433013 -0.75 -0.5
0.150384 -0.852868 -0.5
0.663414 -0.55667 -0.5
0.866025 -2.12115e-16 -0.5
  
0.642788 0 -0.766044
0.492404 0.413176 -0.766044
0.111619 0.633022 -0.766044
-0.321394 0.55667 -0.766044
-0.604023 0.219846 -0.766044
-0.604023 -0.219846 -0.766044
-0.321394 -0.55667 -0.766044
0.111619 -0.633022 -0.766044
0.492404 -0.413176 -0.766044
0.642788 -1.57438e-16 -0.766044
  
0.34202 0 -0.939693
0.262003 0.219846 -0.939693
0.0593912 0.336824 -0.939693
-0.17101 0.296198 -0.939693
-0.321394 0.116978 -0.939693
-0.321394 -0.116978 -0.939693
-0.17101 -0.296198 -0.939693
0.0593912 -0.336824 -0.939693
0.262003 -0.219846 -0.939693
0.34202 -8.37708e-17 -0.939693
  
1.22465e-16 0 -1
9.38134e-17 7.87188e-17 -1
2.12658e-17 1.20604e-16 -1
-6.12323e-17 1.06058e-16 -1
-1.15079e-16 4.18854e-17 -1
-1.15079e-16 -4.18854e-17 -1
-6.12323e-17 -1.06058e-16 -1
2.12658e-17 -1.20604e-16 -1
9.38134e-17 -7.87188e-17 -1
1.22465e-16 -2.99952e-32 -1
  
Other properties can be attached to each vertex; for example, if the file begins with "CNMESH" then it contains colors and normals for each vertex. See the indicated documentation for details.
jReality core developer

petsagouris
Posts: 8
Joined: Sun 26. Aug 2012, 14:15

Re: ReaderMESH input?

Post by petsagouris » Tue 28. Aug 2012, 12:59

Thanks a lot, I am was trying to figure out the type safety warnings eclipse was giving me on the Java 1.7 compiler. This should help I believe.

edit: this is not conformant to what the ReaderMESH.java is parsing, it seems that it expects something in the form of :

Code: Select all

{{d,d,d[d,d]} {d,d,d[d,d]} {d,d,d[d,d]} {d,d,d[d,d]}}
{{d,d,d[d,d]} {d,d,d[d,d]} {d,d,d[d,d]} {d,d,d[d,d]}}
{{d,d,d[d,d]} {d,d,d[d,d]} {d,d,d[d,d]} {d,d,d[d,d]}}

Post Reply