Extrusion question
Author Message
Extrusion question

Dear all I'm trying to generate a wall using extrusion (i figured this is
easier than putting boxes together), but the wall is shown as if it was
hollow (i.e. the facing side is always see thru... see
http://www.*-*-*.com/ ~jxm/wall.wrl). What am I missing? Or I simply
can't do a wall with extrusion?

Thanks, Jules

Shape {
geometry Extrusion {
beginCap TRUE,
endCap TRUE,
solid TRUE,
crossSection [
0 0,
8.655 0,
8.665 5.5,
4.955 5.5,
4.955 3.78,
5.105 3.78,
5.105 5.35,
8.505 5.35,
8.505 .15,
0 .15,
0 0
]
spine [
0 0 0,
0 2.3 0,
0 2.3 0,
0 2.3 0,
0 2.3 0,
0 2.3 0,
0 2.3 0,
0 2.3 0,
0 2.3 0,
0 2.3 0
]
}

}

Mon, 21 Nov 2005 10:02:26 GMT
Extrusion question

Quote:

> Dear all I'm trying to generate a wall using extrusion (i figured this is
> easier than putting boxes together), but the wall is shown as if it was
> hollow (i.e. the facing side is always see thru... see
> http://www.cs.nott.ac.uk/~jxm/wall.wrl). What am I missing? Or I simply
> can't do a wall with extrusion?

> Thanks, Jules

>   Shape {
>     geometry Extrusion {
>      beginCap TRUE,
>        endCap TRUE,
>        solid FALSE
>     crossSection [

Make solid FALSE

Smitty

Mon, 21 Nov 2005 13:07:55 GMT
Extrusion question
Hey, Dr. Joolz:

You're just about there - need to make a couple of minor changes.

First, you want to set solid to FALSE. It's somewhat counterintuitive,
and confuses most people at first (myself included). What solid means is
"you don't have to draw the back faces, because this is one solid
object." Box primitives, for example, are only drawn on the outside - if
you go into a box, the sides disappear. However, in this case you want
to draw the inner and outer faces, so solid should be FALSE.

You're also creating a concave, rather than convex shape (a shape that
bends inward rather than outward), so you want to set convex to FALSE as
well.

The spine is not associated on a point-by-point basis with the
crossSection. You only need to indicate changes in the spine from one
plane to the next. In this case, you only need a spine [0 0 0, 0 2.3 0].
Adding all the extra numbers doesn't have an impact, because you're just
repeating the same plane.

When I make these changes, the code looks like this.

<!-- Begin Snippet -->

#VRML V2.0 utf8

Shape {

# I'm setting a diffuseColor to make it easier to see the shape
appearance Appearance { material Material { diffuseColor  0 0 .5 } }

geometry Extrusion {

#  beginCap TRUE,# Doesn't hurt, but this is a default value
#  endCap TRUE,  # This is also a default

solid FALSE  # This tells it to draw the back faces.
convex FALSE # This indicates the shape bends inward, not outward

# You might consider rounding off some of the numbers in your
# crossSection, unless this level of detail is really significant
# to you. 5 millimeters usually isn't that important when you're
# modeling something as large as a house. Fewer decimal places
# makes smaller files, easier to do the math in your head, etc.

crossSection [
0 0,
8.655 0,
8.665 5.5,
4.955 5.5,
4.955 3.78,
5.105 3.78,
5.105 5.35,
8.505 5.35,
8.505 .15,
0 .15,
0 0
]
spine [
0 0 0,
0 2.3 0 # All the spine you need
]
}
}

<!-- End Snippet -->

Hope that helps. Kudos to you for plunging into IndexedFaceSets.

-dd

Quote:

> Dear all I'm trying to generate a wall using extrusion (i figured this is
> easier than putting boxes together), but the wall is shown as if it was
> hollow (i.e. the facing side is always see thru... see
> http://www.cs.nott.ac.uk/~jxm/wall.wrl). What am I missing? Or I simply
> can't do a wall with extrusion?

> Thanks, Jules

>   Shape {
>     geometry Extrusion {
>      beginCap TRUE,
>        endCap TRUE,
>        solid TRUE,
>     crossSection [
>      0 0,
>      8.655 0,
>      8.665 5.5,
>      4.955 5.5,
>      4.955 3.78,
>      5.105 3.78,
>      5.105 5.35,
>      8.505 5.35,
>      8.505 .15,
>      0 .15,
>      0 0
>     ]
>        spine [
>         0 0 0,
>         0 2.3 0,
>         0 2.3 0,
>         0 2.3 0,
>         0 2.3 0,
>         0 2.3 0,
>         0 2.3 0,
>         0 2.3 0,
>         0 2.3 0,
>         0 2.3 0
>        ]
>       }

>   }

Mon, 21 Nov 2005 13:30:33 GMT
Extrusion question
I see that there were a number of helpful responses to
Dr. Joolz' question about how to knock a hole in a wall.
Here's an approach I used.

The problem with extruding the entire frame of the house
is that there isn't a way to punch holes for the windows
and doors. Using a 3D modeler with boolean capabilities
is a great idea, but I didn't have access to one when I
needed it.

This is the approach I used for the buildings in my bear
town. I created each wall individually, as an elaborate
concave extrusion. It took me some finagling, but I'm
happy with the way they turned out.

http://www.epcomm.com/vrml/portfolo/bear_towne/beartown.htm

<!-- Begin Snippet -->
#VRML V2.0 utf8
DEF frontWall Shape {
appearance Appearance {
texture DEF logTexture PixelTexture {
image 10 1 1  0x00 0xAA 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xDD 0xAA
}
textureTransform TextureTransform {
scale 20 1
rotation -1.57
}
material DEF logBrown Material {
diffuseColor .5 .25 0
}
}
geometry Extrusion {
crossSection [
#shell
-1 0, -1 1.25, 0 2, 1 1.25, 1 0,
#right window
.2 0, .2 .45, .475 .45, .475 .15, .775 .15, .775 .45,
.775 .975, -.775 .975, -.775 .675,
-.475 .675, -.475 .975, -.15 .975,   # upper
-.15 .675, .15 .675, .15 .975, .475   # windows
.975, .475 .675, .775 .675, .775 .45,
#left window
-.2 .45, -.475 .45, -.775 .45, -.775 .15,
-.475 .15, -.475 .45,
-.2 .45, -.2 0, -1 0]
spine [ 0 0 0, 0  0 -.0125]
convex FALSE
}
}
<!-- End Snippet-->

Hope that helps.

-dd

Mon, 21 Nov 2005 13:52:30 GMT
Extrusion question
Hi there, thanks so much for your help :-) One more thing do you know how to
texture just the outside of the wall? Actually I want to have different
imagetexture for the inside and the outside of the wall, is that possible at
all? When I do a texture the whole wall inside and out gets it.

Thanks, Jules

--
***24 hours in a day...24 beers in a case...coincidence?***

Quote:
> Hey, Dr. Joolz:

> You're just about there - need to make a couple of minor changes.

> First, you want to set solid to FALSE. It's somewhat counterintuitive,
> and confuses most people at first (myself included). What solid means is
> "you don't have to draw the back faces, because this is one solid
> object." Box primitives, for example, are only drawn on the outside - if
> you go into a box, the sides disappear. However, in this case you want
> to draw the inner and outer faces, so solid should be FALSE.

> You're also creating a concave, rather than convex shape (a shape that
> bends inward rather than outward), so you want to set convex to FALSE as
> well.

> The spine is not associated on a point-by-point basis with the
> crossSection. You only need to indicate changes in the spine from one
> plane to the next. In this case, you only need a spine [0 0 0, 0 2.3 0].
> Adding all the extra numbers doesn't have an impact, because you're just
> repeating the same plane.

> When I make these changes, the code looks like this.

> <!-- Begin Snippet -->

> #VRML V2.0 utf8

>    Shape {

>      # I'm setting a diffuseColor to make it easier to see the shape
>      appearance Appearance { material Material { diffuseColor  0 0 .5 } }

>      geometry Extrusion {

>         #  beginCap TRUE,# Doesn't hurt, but this is a default value
>         #  endCap TRUE,  # This is also a default

>         solid FALSE  # This tells it to draw the back faces.
>         convex FALSE # This indicates the shape bends inward, not outward

>        # You might consider rounding off some of the numbers in your
>        # crossSection, unless this level of detail is really significant
>        # to you. 5 millimeters usually isn't that important when you're
>        # modeling something as large as a house. Fewer decimal places
>        # makes smaller files, easier to do the math in your head, etc.

>      crossSection [
>       0 0,
>       8.655 0,
>       8.665 5.5,
>       4.955 5.5,
>       4.955 3.78,
>       5.105 3.78,
>       5.105 5.35,
>       8.505 5.35,
>       8.505 .15,
>       0 .15,
>       0 0
>      ]
>         spine [
>          0 0 0,
>          0 2.3 0 # All the spine you need
>         ]
>        }
>    }

> <!-- End Snippet -->

> Hope that helps. Kudos to you for plunging into IndexedFaceSets.

> -dd

> > Dear all I'm trying to generate a wall using extrusion (i figured this
is
> > easier than putting boxes together), but the wall is shown as if it was
> > hollow (i.e. the facing side is always see thru... see
> > http://www.cs.nott.ac.uk/~jxm/wall.wrl). What am I missing? Or I simply
> > can't do a wall with extrusion?

> > Thanks, Jules

> >   Shape {
> >     geometry Extrusion {
> >      beginCap TRUE,
> >        endCap TRUE,
> >        solid TRUE,
> >     crossSection [
> >      0 0,
> >      8.655 0,
> >      8.665 5.5,
> >      4.955 5.5,
> >      4.955 3.78,
> >      5.105 3.78,
> >      5.105 5.35,
> >      8.505 5.35,
> >      8.505 .15,
> >      0 .15,
> >      0 0
> >     ]
> >        spine [
> >         0 0 0,
> >         0 2.3 0,
> >         0 2.3 0,
> >         0 2.3 0,
> >         0 2.3 0,
> >         0 2.3 0,
> >         0 2.3 0,
> >         0 2.3 0,
> >         0 2.3 0,
> >         0 2.3 0
> >        ]
> >       }

> >   }

Tue, 22 Nov 2005 16:48:17 GMT
Extrusion question

Quote:

> Hi there, thanks so much for your help :-) One more thing do you know how to
> texture just the outside of the wall? Actually I want to have different
> imagetexture for the inside and the outside of the wall, is that possible at
> all? When I do a texture the whole wall inside and out gets it.

> Thanks, Jules

I don't know of a way to control texture mapping on an extrusion (I'll
go out on a limb and say you can't). You can control texture mapping on
an IndexedFaceSet, so you have the option of switching.

However, I'm lazy. What I would do is extrude two walls and put them
together.

<!-- Begin Snippet -->

#VRML V2.0 utf8
Shape{
geometry  Extrusion {
crossSection [
-2.0 0.0
-2.0 2.0
2.0 2.0
2.0 0.0
0.0 0.0
0.0 0.4
0.6 0.4
0.6 1.2
-0.6 1.2
-0.6 0.4
0.0 0.4
0.0 0.0
-2.0 0.0
]
spine [ 0 0 0 0 0 -.1 ]
solid FALSE
convex FALSE
}
appearance Appearance {
texture DEF logTexture PixelTexture {
image 10 1 1  0x00 0xAA 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xDD 0xAA
}
textureTransform TextureTransform {
scale 20 1
rotation -1.57
}
material DEF logBrown Material {
diffuseColor .5 .25 0
}
}

Quote:
}

Shape {
geometry Extrusion {
crossSection [
-2.0 0.0
-2.0 2.0
2.0 2.0
2.0 0.0
0.0 0.0
0.0 0.4
0.6 0.4
0.6 1.2
-0.6 1.2
-0.6 0.4
0.0 0.4
0.0 0.0
-2.0 0.0
]
spine [0 0 -.1 0 0 -.125] #Start this spine where the first ends
solid FALSE
convex FALSE
}
appearance Appearance {
material Material {
diffuseColor 1 1 0
}
}
Quote:
}

<!-- End Snippet -->

Hope that helps.

-dd

Tue, 22 Nov 2005 22:06:58 GMT

 Page 1 of 1 [ 8 post ]

Relevant Pages