|
| after having been bitten again by this bug in blaxxun contact, esp.in
complex worlds where its nice fast engine is particularly useful, i've
spent some time pinned it down and produced the simplest example i can
think of that exhibits it, also found a work-round.
code below works,( produces 3 different flat shapes ) but only does so
when the dummy def is included.
#VRML V2.0 utf8
PROTO IndexedFaceSetShapeSubClass [
field MFVec3f def []
]{
Shape {
appearance Appearance { material Material { } }
geometry DEF main IndexedFaceSet {
coordIndex [0,1,2,3]
coord DEF dummyDef Coordinate { point [] } }
}
DEF build Script {
field SFNode faceSet USE main
field MFVec3f points IS def
## comment the dummy line below and blaxxun contact uses the points
from the last use for all nodes made from this proto!!
field SFNode faceSet1 USE dummyDef
directOutput TRUE
url ["java script:
function initialize(){
faceSet.coord.point=points ;
}
"]
}}
## oblong
IndexedFaceSetShapeSubClass {def [0 0 0,2 0 0,2 .5 0,0 .5 0,]}
Transform {translation -2.5 0 0
children [
## square
IndexedFaceSetShapeSubClass {def [0 0 0,1 0 0,1 1 0,0 1 0,]}
]
}
Transform {translation 2.5 0 0
children [
## oblong
IndexedFaceSetShapeSubClass {def [0 0 0,.5 0 0,.5 2 0,0 2 0,]}
]
}
|
|