修改过去不标准贴图,修改代码生成的不标准材质
@ -263,8 +263,8 @@ export function Jlmap3dSubscribe(jlmap3d) {
|
||||
trainlisttest.list[code].dispose = false;
|
||||
trainlisttest.list[code].nowcode = data.body[i].sectionCode;
|
||||
trainlisttest.list[code].nextcode = data.body[i].nextSectionCode;
|
||||
const vexlist = [];
|
||||
const endrotation = null;
|
||||
let vexlist = [];
|
||||
let endrotation = null;
|
||||
|
||||
if (data.body[i].directionType == '02') { // 向右
|
||||
let offset = null;
|
||||
@ -278,13 +278,15 @@ export function Jlmap3dSubscribe(jlmap3d) {
|
||||
rotaposx = sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x+offset*data.body[i].sectionOffsetPercent;
|
||||
}
|
||||
|
||||
const rotaposz = sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].z;
|
||||
let rotaposz = sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].z;
|
||||
|
||||
trainlisttest.list[code].rotation.y = 0;
|
||||
trainlisttest.list[code].position.x = rotaposx;
|
||||
trainlisttest.list[code].position.y = 0;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = rotaposz;
|
||||
}
|
||||
|
||||
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x>sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) {
|
||||
vexlist.push(new THREE.Vector3(rotaposx, 0, rotaposz));
|
||||
for (let m=sectionlist.sections.datalist[data.body[i].sectionCode].rail.length-1; m>=0; m--) {
|
||||
@ -319,16 +321,15 @@ export function Jlmap3dSubscribe(jlmap3d) {
|
||||
offset = sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x-sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x;
|
||||
rotaposx = sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x+offset*data.body[i].sectionOffsetPercent;
|
||||
}
|
||||
const rotaposz = sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].z;
|
||||
let rotaposz = sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].z;
|
||||
|
||||
trainlisttest.list[code].rotation.y = Math.PI;
|
||||
trainlisttest.list[code].position.x = rotaposx;
|
||||
trainlisttest.list[code].position.y = 0;
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = rotaposz;
|
||||
}
|
||||
if (data.body[i].groupNumber == '001') {
|
||||
}
|
||||
|
||||
for (let tl=0; tl<6; tl++) {
|
||||
trainlisttest.list[code].children[tl].position.z = -rotaposz;
|
||||
}
|
||||
if (sectionlist.sections.datalist[data.body[i].sectionCode].rail[0].x<sectionlist.sections.datalist[data.body[i].sectionCode].rail[1].x) {
|
||||
vexlist.push(new THREE.Vector3(rotaposx, 0, rotaposz));
|
||||
for (let m=sectionlist.sections.datalist[data.body[i].sectionCode].rail.length-1; m>=0; m--) {
|
||||
@ -344,17 +345,25 @@ export function Jlmap3dSubscribe(jlmap3d) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
trainlisttest.list[code].status = '03';
|
||||
}
|
||||
|
||||
trainlisttest.list[code].curve = new THREE.CatmullRomCurve3(vexlist);
|
||||
trainlisttest.list[code].isStandTrack = sectionlist.sections.datalist[data.body[i].sectionCode].isStandTrack;
|
||||
trainlisttest.list[code].progress = 0;
|
||||
trainlisttest.list[code].len = sectionlist.sections.datalist[data.body[i].sectionCode].distance;
|
||||
trainlisttest.list[code].speed = data.body[i].speed;
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/20/trainlisttest.list[code].len);
|
||||
}
|
||||
|
||||
|
||||
if(data.body[i].speed == 0){
|
||||
trainlisttest.list[code].speeds = data.body[i].speed;
|
||||
trainlisttest.list[code].speeds = 0;
|
||||
// trainlisttest.list[code].startmark = 1;
|
||||
}else{
|
||||
trainlisttest.list[code].speeds = data.body[i].speed;
|
||||
trainlisttest.list[code].speeds = parseFloat(data.body[i].speed*10/36/20/trainlisttest.list[code].len);
|
||||
}
|
||||
|
||||
}
|
||||
} else if (trainlisttest.list[code].dispose != data.body[i].dispose && data.body[i].dispose == true) {
|
||||
trainlisttest.group.remove(trainlisttest.list[code]);
|
||||
trainlisttest.list[code].progress = null;
|
||||
|
@ -340,33 +340,33 @@ stationcanvas.src = "../../static/texture/msgt.png";
|
||||
function getTextCanvas(text){
|
||||
let canvas = document.getElementById('canvastexture');
|
||||
|
||||
canvas.width = 300;
|
||||
canvas.height = 374;
|
||||
canvas.width = 256;
|
||||
canvas.height = 512;
|
||||
// canvas.style.width = width;
|
||||
// canvas.style.height = height;
|
||||
|
||||
let ctx = canvas.getContext('2d');
|
||||
//ctx.fillStyle = '#FFFFFF';
|
||||
ctx.fillRect(0, 0,300,374);
|
||||
ctx.fillRect(0, 0,256,512);
|
||||
|
||||
ctx.fillStyle = '#FFFFFF';
|
||||
// ctx.textAlign = 'center';
|
||||
// ctx.textBaseline = 'middle';
|
||||
ctx.clearRect(0,0,300,374);
|
||||
ctx.clearRect(0,0,256,512);
|
||||
|
||||
ctx.drawImage(stationcanvas,0,0,300,374);
|
||||
ctx.drawImage(stationcanvas,0,0,256,512);
|
||||
|
||||
ctx.font = "20px Verdana";
|
||||
ctx.fillText("车站名称: "+text.runPlanName, 40,58);
|
||||
ctx.fillText("车站名称: "+text.runPlanName, 20,58);
|
||||
|
||||
ctx.fillText("漫游", 40,110);
|
||||
ctx.fillText("信息", 124,110);
|
||||
ctx.fillText("备忘", 210,110);
|
||||
ctx.fillText("漫游", 30,100);
|
||||
ctx.fillText("信息", 114,100);
|
||||
ctx.fillText("备忘", 190,100);
|
||||
|
||||
ctx.fillText("车站序号: "+text.name, 40,155);
|
||||
|
||||
ctx.fillText("公里标记:"+text.kmPost,40 ,256*3/4);
|
||||
|
||||
let data = ctx.getImageData(0, 0,300,374);
|
||||
let data = ctx.getImageData(0, 0,256,512);
|
||||
return data;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
BIN
static/texture/msgfo.png
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 16 KiB |
BIN
static/texture/msgto.png
Normal file
After Width: | Height: | Size: 11 KiB |