Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 三个js立方体的一面/侧面上的覆盖_Javascript_Three.js - Fatal编程技术网

Javascript 三个js立方体的一面/侧面上的覆盖

Javascript 三个js立方体的一面/侧面上的覆盖,javascript,three.js,Javascript,Three.js,我正在构建一个立方体,它的四个面上都有天气信息。现在我想在立方体的第二个面上显示日出、日落、白天持续时间和月亮升起、月亮落下和夜间持续时间,并在两个覆盖层内显示一些不透明度。我们怎么能在threejs立方体的一面/侧面上有两个单独的覆盖层,其中包含一些文本?我们可以做一个有一定宽度和高度的div,给它一个颜色和不透明度,然后把文本放进去吗?我在网上找不到什么帮助。希望在这里找到解决办法 dynamicTextures.push(_this.dynamicTextureForFaceTex

我正在构建一个立方体,它的四个面上都有天气信息。现在我想在立方体的第二个面上显示日出、日落、白天持续时间和月亮升起、月亮落下和夜间持续时间,并在两个覆盖层内显示一些不透明度。我们怎么能在threejs立方体的一面/侧面上有两个单独的覆盖层,其中包含一些文本?我们可以做一个有一定宽度和高度的div,给它一个颜色和不透明度,然后把文本放进去吗?我在网上找不到什么帮助。希望在这里找到解决办法

    dynamicTextures.push(_this.dynamicTextureForFaceTextAndImage1(current_temp,feed.RealFeelTemperature,this.hi_lo,this.precip,feed.WeatherText,data['cube_color'],data['header_overlay_color'],data['daytime_cube_color'],data['nighttime_cube_color'],data['image1'],data['weatherinfo_font'],data['weatherinfo_font_color'],data['weatherinfo_font_bold'],data['weatherinfo_font_italic'],feed.IsDayTime));
    dynamicTextures.push(_this.dynamicTextureForFaceTextAndImage1(current_temp,feed.RealFeelTemperature,this.hi_lo,this.precip,feed.WeatherText,data['cube_color'],data['header_overlay_color'],data['daytime_cube_color'],data['nighttime_cube_color'],data['image1'],data['weatherinfo_font'],data['weatherinfo_font_color'],data['weatherinfo_font_bold'],data['weatherinfo_font_italic'],feed.IsDayTime));
    dynamicTextures.push(_this.dynamicTextureForFaceTextAndImage1(current_temp,feed.RealFeelTemperature,this.hi_lo,this.precip,feed.WeatherText,data['cube_color'],data['header_overlay_color'],data['daytime_cube_color'],data['nighttime_cube_color'],data['image1'],data['weatherinfo_font'],data['weatherinfo_font_color'],data['weatherinfo_font_bold'],data['weatherinfo_font_italic'],feed.IsDayTime));
    dynamicTextures.push(_this.dynamicTextureForFaceTextAndImage1(current_temp,feed.RealFeelTemperature,this.hi_lo,this.precip,feed.WeatherText,data['cube_color'],data['header_overlay_color'],data['daytime_cube_color'],data['nighttime_cube_color'],data['image1'],data['weatherinfo_font'],data['weatherinfo_font_color'],data['weatherinfo_font_bold'],data['weatherinfo_font_italic'],feed.IsDayTime));
    dynamicTextures.push(_this.dynamicTextureForFaceTextAndImage2(this.day_text,feed.Sunrise,feed.Sunset,this.day_duration,this.night_text,feed.Moonrise,feed.Moonrise,this.night_duration,data['cube_color'],data['header_overlay_color'],data['daytime_cube_color'],data['nighttime_cube_color'],data['image2'],data['image3'],data['weatherinfo_font'],data['weatherinfo_font_color'],data['weatherinfo_font_bold'],data['weatherinfo_font_italic'],feed.IsDayTime));
    dynamicTextures.push(_this.dynamicTextureForFaceTextAndImage4(feed.WindSpeed,feed.WindDirection,feed.WindGust,feed.Humidity,feed.Pressure,feed.UVIndex,feed.CloudCover,feed.Ceiling,feed.DewPoint,feed.Visibility,data['cube_color'],data['header_overlay_color'],data['daytime_cube_color'],data['nighttime_cube_color'],data['image1'],data['weatherinfo_font'],data['weatherinfo_font_color'],data['weatherinfo_font_bold'],data['weatherinfo_font_italic'],feed.IsDayTime));

var text = [];
    for (var i = 0; i < dynamicTextures.length; i++) {
        text.push(new THREE.MeshLambertMaterial({
            ambient: 0xffffff,
            map: dynamicTextures[i].texture
        }))
    }

     var geo = new THREE.BoxGeometry(data['cube_width'],data['cube_height'],data['cube_depth']); // w, h, d
    _this.cube = new THREE.Mesh(geo, new THREE.MeshFaceMaterial(text));
    //var cube    = new THREE.Mesh( geo, materialText );
    _this.cube.name = "scene-1-lambert-cube";
    scene.add(_this.cube);
dynamicTextures.push(\u this.dynamicTextureForFaceTextAndImage1(当前温度,提要。RealFeelTemperature,this.hi\u-lo,this.precip,feed.WeatherText,数据['cube\u color'],数据['header\u overlay\u color'],数据['Daily\u cube\u color'],数据['nighttime\u cube\u color'],数据['image1'],数据['weatherinfo\u font'],数据['weatherinfo\u color']['weatherinfo_font_bold'],数据['weatherinfo_font_italic'],feed.IsDayTime];
dynamicTextures.push(_this.dynamicTextureForFaceTextAndImage1(当前温度,feed.RealFeelTemperature,this.hi\u-lo,this.precip,feed.WeatherText,数据['cube\u color'],数据['header\u overlay\u color'],数据['Daily\u cube\u color'],数据['nighttime\u cube\u color'],数据['image1'],数据['weatherinfo\u font'],数据['weatherinfo\u color']['weatherinfo_font_italic'],feed.IsDayTime];
dynamicTextures.push(_this.dynamicTextureForFaceTextAndImage1(当前温度,feed.RealFeelTemperature,this.hi\u-lo,this.precip,feed.WeatherText,数据['cube\u color'],数据['header\u overlay\u color'],数据['Daily\u cube\u color'],数据['nighttime\u cube\u color'],数据['image1'],数据['weatherinfo\u font'],数据['weatherinfo\u color']['weatherinfo_font_italic'],feed.IsDayTime];
dynamicTextures.push(_this.dynamicTextureForFaceTextAndImage1(当前温度,feed.RealFeelTemperature,this.hi\u-lo,this.precip,feed.WeatherText,数据['cube\u color'],数据['header\u overlay\u color'],数据['Daily\u cube\u color'],数据['nighttime\u cube\u color'],数据['image1'],数据['weatherinfo\u font'],数据['weatherinfo\u color']['weatherinfo_font_italic'],feed.IsDayTime];
dynamicTextures.push(_this.dynamicTextureForFaceTextAndImage2(this.day_文本,feed.Sunrise,feed.日落,this.day_持续时间,this.night_文本,feed.Moonrise,feed.Moonrise,feed.Moonrise,this.night_持续时间,data['cube_color',data['header_overlay_color'],data['daily_cube_color'],data['daily(cube_color'],data['dailty(night)cube(cube(color']],data['nigh['weatherinfo_font_color'],数据['weatherinfo_font_bold'],数据['weatherinfo_font_italic'],feed.IsDayTime];
dynamicTextures.push(_this.dynamicTextureForFaceTextAndImage4(feed.风速,feed.风向,feed.阵风,feed.湿度,feed.压力,feed.紫外线指数,feed.云量,feed.天花板,feed.露点,feed.可见性,数据['cube\u color',数据['header\u overlay\u color',数据['Daily\u cube\u color',数据['nighttime\u cube\u color',数据['image1',数据['weatherinfo_font'],数据['weatherinfo_font_color'],数据['weatherinfo_font_bold'],数据['weatherinfo_font_italic'],feed.IsDayTime];
var text=[];
对于(var i=0;i