How to make kaleidoscopes in VRML

Step 0.

Make sure you have WebGL support in your browser

Step 1.


#VRML V2.0 utf8

Shape {
  geometry IndexedFaceSet {   
    coord Coordinate {
      point [
        -1   0   0, 
        0   0   0, 
        -0.5 0.866025 0
      ]
    }  
    coordIndex [
      0, 1, 2,-1
    ]
  }  
}

VRML

Step 2.

#VRML V2.0 utf8

Shape {
  geometry IndexedFaceSet {   
  coord Coordinate{
    point [
      -1   0   0, 
       0   0   0, 
      -0.5 0.866025 0
    ]
  }  
  coordIndex [
    0, 1, 2,-1
  ]

  texCoord TextureCoordinate {   
  point [ 
    0   0, 
    1   0, 
    0.5 0.866025
  ]
  }
  texCoordIndex [
    0 1 2 -1
  ]
  }
  appearance Appearance{  
  texture ImageTexture {
      url["tex/random7.jpg"]
  }  
    }
}

VRML

Step 3.

#VRML V2.0 utf8

Shape {
    geometry IndexedFaceSet{
    coord Coordinate{
      point [
        -1   0   0, 
         0   0   0, 
        -0.5 0.866025 0,
         0.5 0.866025 0
        ]
    }  
    coordIndex [
      0, 1, 2,-1,
      1, 3, 2,-1
    ]
    texCoord TextureCoordinate {   
      point [ 
        0   0, 
        1   0, 
        0.5 0.866025
      ]
    }
    texCoordIndex [
      0 1 2 -1,
      1 0 2 -1
    ]
  }
  appearance Appearance{  
    texture ImageTexture {
      url["tex/random7.jpg"]
    }  
  }
}

VRML

Step 4.

#VRML V2.0 utf8

DEF CELL Shape {
  geometry IndexedFaceSet{
  coord Coordinate{
  point [ 
    -1   0 0, 
     0   0 0, 
    -0.5 0.866025 0, 
     0.5 0.866025 0
  ]
  }  
  coordIndex [
    0, 1, 2,-1,
    1, 3, 2,-1
  ]
  texCoord TextureCoordinate {
  point [ 
    0   0, 
    1   0, 
    0.5 0.866025
  ]
  }
  texCoordIndex [
    0 1 2 -1,
    1 0 2 -1
  ]
    }
  appearance Appearance{  
    texture DEF TEXTURE ImageTexture {   
      url["tex/random7.jpg"]
    }  
  }
}

Transform {
    rotation 0 0 1 2.094395
    children USE CELL
}
Transform {
    rotation 0 0 1 -2.094395
    children USE CELL
}

VRML

© Copyright 1997-2023 Vladimir Bulatov
http://bulatov.org