|
@@ -415,7 +415,9 @@ THREE.VRMLLoader.prototype = {
|
|
|
};
|
|
|
|
|
|
break;
|
|
|
-
|
|
|
+
|
|
|
++ case 'location':
|
|
|
++ case 'direction':
|
|
|
case 'translation':
|
|
|
case 'scale':
|
|
|
case 'size':
|
|
@@ -434,6 +436,8 @@ THREE.VRMLLoader.prototype = {
|
|
|
|
|
|
break;
|
|
|
|
|
|
+ case 'intensity':
|
|
|
+ case 'cutOffAngle':
|
|
|
case 'radius':
|
|
|
case 'topRadius':
|
|
|
case 'bottomRadius':
|
|
@@ -468,7 +472,8 @@ THREE.VRMLLoader.prototype = {
|
|
|
};
|
|
|
|
|
|
break;
|
|
|
-
|
|
|
+
|
|
|
+ case 'on':
|
|
|
case 'ccw':
|
|
|
case 'solid':
|
|
|
case 'colorPerVertex':
|
|
@@ -623,6 +628,85 @@ THREE.VRMLLoader.prototype = {
|
|
|
|
|
|
var object = parent;
|
|
|
|
|
|
+ if(data.string.indexOf("AmbientLight")>-1 && data.nodeType=='PointLight'){
|
|
|
+ //wenn im Namen "AmbientLight" vorkommt und es ein PointLight ist,
|
|
|
+ //diesen Typ in 'AmbientLight' ändern
|
|
|
+ data.nodeType='AmbientLight';
|
|
|
+ }
|
|
|
+
|
|
|
+ l_visible=data.on;
|
|
|
+ if(l_visible==undefined)l_visible=true;
|
|
|
+ l_intensity=data.intensity;
|
|
|
+ if(l_intensity==undefined)l_intensity=true;
|
|
|
+ if(data.color!=undefined)
|
|
|
+ l_color= new THREE.Color(data.color.r, data.color.g,data.color.b );
|
|
|
+ else
|
|
|
+ l_color= new THREE.Color(0, 0,0);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if('AmbientLight' === data.nodeType){
|
|
|
+ object=new THREE.AmbientLight(
|
|
|
+ l_color.getHex(),
|
|
|
+ l_intensity
|
|
|
+ );
|
|
|
+ object.visible=l_visible;
|
|
|
+
|
|
|
+ parent.add( object );
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ if('PointLight' === data.nodeType){
|
|
|
+ l_distance =0; //0="unendlich" ...1000
|
|
|
+ l_decay=0; //-1.. ?
|
|
|
+
|
|
|
+ if(data.radius!=undefined && data.radius<1000){
|
|
|
+ //l_radius=data.radius;
|
|
|
+ l_distance=data.radius;
|
|
|
+ l_decay=1;
|
|
|
+ }
|
|
|
+ object=new THREE.PointLight(
|
|
|
+ l_color.getHex(),
|
|
|
+ l_intensity,
|
|
|
+ l_distance);
|
|
|
+ object.visible=l_visible;
|
|
|
+
|
|
|
+ parent.add( object );
|
|
|
+ }
|
|
|
+ else
|
|
|
+ if('SpotLight' === data.nodeType){
|
|
|
+ l_intensity=1;
|
|
|
+ l_distance =0;//0="unendlich"=1000
|
|
|
+ l_angle=Math.PI/3;
|
|
|
+ l_penumbra=0.0;//0..1
|
|
|
+ l_decay=0;//-1.. ?
|
|
|
+ l_visible=true;
|
|
|
+
|
|
|
+ if(data.radius!=undefined && data.radius<1000){
|
|
|
+ //l_radius=data.radius;
|
|
|
+ l_distance=data.radius;
|
|
|
+ l_decay=1;
|
|
|
+ }
|
|
|
+ if(data.cutOffAngle!=undefined)l_angle=data.cutOffAngle;
|
|
|
+
|
|
|
+ object = new THREE.SpotLight(
|
|
|
+ l_color.getHex(),
|
|
|
+ l_intensity,
|
|
|
+ l_distance,
|
|
|
+ l_angle,
|
|
|
+ l_penumbra,
|
|
|
+ l_decay
|
|
|
+ );
|
|
|
+ object.visible=l_visible;
|
|
|
+ parent.add( object );
|
|
|
+ /*
|
|
|
+ var lightHelper = new THREE.SpotLightHelper( object );
|
|
|
+ parent.parent.add( lightHelper );
|
|
|
+ lightHelper.update();
|
|
|
+ */
|
|
|
+ }
|
|
|
+ else
|
|
|
+
|
|
|
if ( 'Transform' === data.nodeType || 'Group' === data.nodeType ) {
|
|
|
|
|
|
object = new THREE.Object3D();
|