?
Solved

What kind of shape does this WRL snippet make?

Posted on 2012-08-12
5
Medium Priority
?
689 Views
Last Modified: 2012-08-13
Does anyone know what kind of shape this vrml snippet would give me?

My understanding is that there are two faces according to the coordIndex, but I'm puzzled as to what kind of shape that is?

Collision {
  children Shape {
    appearance Appearance { material Material {} }
    geometry IndexedFaceSet {
      coord Coordinate {
        point [
        0.01 0.30 0.02, 0.02 0.45 0.02, 0.02 0.62 0.03, 0.01 0.43 0.03, 
        ]}
        coordIndex[
        0 1 2 3 0 -1, 3 2 1 0 3 -1, 
        ]
}}}

Open in new window


I'm a total noob to this. Thanks.
0
Comment
Question by:Kyle Hamilton
  • 3
  • 2
5 Comments
 
LVL 36

Assisted Solution

by:mccarl
mccarl earned 2000 total points
ID: 38286201
The shape would just be a flat 4 sided polygon, (probably something like a parallelogram shape). It has no volume.

If your main stumbling block is why there are TWO faces, it would most likely be because of how faces in 3d work. Every face would have an inside and outside "side" to it, and which side is which is defines by the order that the indexes are given in. The fact that the two faces are given with the same indexes just in opposite order means that the two faces are exactly the same but facing opposite directions. Think of it this way, you have two pieces of paper, both of which are red on one side and blue on the other. Now glue the two pieces together so that the blue sides are glued together, and the red sides are facing out. That is basically what you have above, two faces stuck together so that there outsides are facing away from each other, and there insides are "stuck" together.

Hope that helps to understand what is happening...
0
 
LVL 25

Author Comment

by:Kyle Hamilton
ID: 38286230
awesome, thanks so much, really appreciate the help.

What about the coordinate points themselves? what do they represent? Are those the vertices in a 3d space? xyz coordinates? how do they relate to the faces?

(This btw, came from eeg recordings of the brain)

if it's of any assitance, here's three shapes in a row:

Collision {
  children Shape {
    appearance Appearance { material Material {} }
    geometry IndexedFaceSet {
      coord Coordinate {
        point [
        0.01 0.30 0.02, 0.02 0.45 0.02, 0.02 0.62 0.03, 0.01 0.43 0.03, 
        ]}
        coordIndex[
        0 1 2 3 0 -1, 3 2 1 0 3 -1, 
        ]
}}}
Collision {
  children Shape {
    appearance Appearance { material Material {} }
    geometry IndexedFaceSet {
      coord Coordinate {
        point [
        0.02 0.45 0.02, 0.02 0.50 0.02, 0.02 0.68 0.03, 0.02 0.62 0.03, 
        ]}
        coordIndex[
        0 1 2 3 0 -1, 3 2 1 0 3 -1, 
        ]
}}}
Collision {
  children Shape {
    appearance Appearance { material Material {} }
    geometry IndexedFaceSet {
      coord Coordinate {
        point [
        0.02 0.50 0.02, 0.03 0.47 0.02, 0.03 0.64 0.03, 0.02 0.68 0.03, 
        ]}
        coordIndex[
        0 1 2 3 0 -1, 3 2 1 0 3 -1, 
        ]
}}}

Open in new window

0
 
LVL 36

Accepted Solution

by:
mccarl earned 2000 total points
ID: 38286285
Are those the vertices in a 3d space? xyz coordinates?

Exactly!!

Note however, that I'm sure that VRML (i'm not really an expert on it but I'm sure it would be similar to other 3D things) would have a number of different co-ordinate systems, local, global, viewpoint, etc. Meaning that while the vertices on the shapes will always be related to each other in the same way, the shape as a whole may get rotated, shifted, scaled, stretched, etc.


how do they relate to the faces?

Not sure exactly what you are asking here. The co-ordinates are vertices in 3D space, and the face is the polygon made up by joining the vertices by lines/edges (in the order given in coordIndex).   Is that what you are asking, or is there still something that you are unsure of?
0
 
LVL 25

Author Closing Comment

by:Kyle Hamilton
ID: 38287102
thank you so much. I have much to learn :)
0
 
LVL 36

Expert Comment

by:mccarl
ID: 38287610
Not a problem. Glad to help!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Simple Linear Regression
Screencast - Getting to Know the Pipeline

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question