We help IT Professionals succeed at work.

# What kind of shape does this WRL snippet make?

on
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,
]
}}}
``````

I'm a total noob to this. Thanks.
Comment
Watch Question

## View Solutions Only

IT Business Systems Analyst / Software Developer
CERTIFIED EXPERT
Top Expert 2015
Commented:
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...
Data Scientist
Most Valuable Expert 2014

Commented:
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,
]
}}}
``````
IT Business Systems Analyst / Software Developer
CERTIFIED EXPERT
Top Expert 2015
Commented:
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?
Data Scientist
Most Valuable Expert 2014

Commented:
thank you so much. I have much to learn :)
IT Business Systems Analyst / Software Developer
CERTIFIED EXPERT
Top Expert 2015

Commented:
Not a problem. Glad to help!