Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: 官方例子中CustomPrimitive不显示问题 #79

Open
kylin222 opened this issue Apr 13, 2020 · 2 comments
Open

bug: 官方例子中CustomPrimitive不显示问题 #79

kylin222 opened this issue Apr 13, 2020 · 2 comments

Comments

@kylin222
Copy link

官方例子--数字城市(earth-digitalCity.html)中createBasePoint方法中的效果不显示

// 底面动态辐射波
{
const evalString = p.canvasWidth = 512; p.canvasHeight = 512; setTimeout(() => { p.drawCanvas(ctx => { ctx.clearRect(0, 0, 512, 512); ctx.strokeStyle = "rgb(255, 0, 0)"; ctx.setLineDash([80, 80]); ctx.lineWidth = 30; ctx.arc(256, 256, 241, 0, Math.PI * 2, true); ctx.stroke(); }); }, 0);
const preUpdateEvalString = if (typeof p.dAngle === 'undefined') p.dAngle = 0.0; if (typeof p.dt === 'undefined') p.dt = 0.01; p.dAngle += 10.0; if (p.dAngle > 360.0) { p.dAngle = 0.0; } p.rotation[0] = p.dAngle / 180.0 * Math.PI; p.dt += 0.02; if (p.dt > 1.0) p.dt = 0.01; p.scale[0] = 50 * p.dt; p.scale[1] = 50 * p.dt;;
const config = {
evalString,
preUpdateEvalString,
position: position,
scale: [50, 50, 1],
positions: [...XE.Obj.CustomPrimitive.Geometry.unitSquare.positions],
sts: [...XE.Obj.CustomPrimitive.Geometry.unitSquare.sts],
indices: [...XE.Obj.CustomPrimitive.Geometry.unitSquare.indices],
renderState: XE.Obj.CustomPrimitive.getRenderState(false, false),
color: [1, 1, 1, 1],
canvasWidth: 512,
canvasHeight: 512
};
let p = new XE.Obj.CustomPrimitive(this.earth);
p.xbsjFromJSON(config);
}

@kylin222 kylin222 changed the title 官方例子中CustomPrimitive不显示问题 bug: 官方例子中CustomPrimitive不显示问题 Apr 20, 2020
@zhengbaofeng
Copy link

我也发现而且是mac 不显示,windows 正常

@kylin222
Copy link
Author

我也发现而且是mac 不显示,windows 正常

是不是因为Mac没有显卡的原因,Mac还有一些bug,比如有些实体设置颜色,设置白色永远显示的是黄色,Windows上正常

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants