用户:
神岛吉吉喵查看:1715 回复:54 评论:73 创建时间:2022-07-01T19:02:52
最近阿吉看到不少美术场景优秀的地图作品
出现了一些之前没见过的功能
比如风车、水车的旋转
到底是怎么实现的呢?![]()



于是趁着月黑风高,阿吉偷偷潜入地图
成为了一名代码搬运工!
//旋转动画
async function loopRotateEntityZ(entityName, time = 30, angle = -Math.PI / 36) { //loopRotateEntity=90度类型
const entity = world.querySelector(`#${entityName}`)
while (1) {
await sleep(time)//数越小越快
entity.meshOrientation = entity.meshOrientation.rotateZ(angle)//PI=180度
}
}
async function loopRotateEntityX(entityName, time = 30, angle = -Math.PI / 36) { //loopRotateEntity=90度类型
const entity = world.querySelector(`#${entityName}`)
while (1) {
await sleep(time)//数越小越快
entity.meshOrientation = entity.meshOrientation.rotateX(angle)//PI=180度
}
}
world.querySelectorAll('*').forEach(e => {
if (e.id.startsWith('水车')) {
loopRotateEntityX(e.id, 30, Math.PI / 36)
}
})
world.querySelectorAll('*').forEach(e => {
if (e.id.startsWith('水动X')) {
loopRotateEntityX(e.id, 100, Math.PI / 1)
}
})
world.querySelectorAll('*').forEach(e => {
if (e.id.startsWith('水动Z')) {
loopRotateEntityZ(e.id, 100, Math.PI / 1)
}
})
loopRotateEntityZ('风车部件01-1')
loopRotateEntityZ('风格部件03-1')
悄悄提示一下:
想实现图里的效果,光代码还不够
记得善用模型的打组功能哦!
打组功能教程:https://shequ.codemao.cn/community/420951
快去地图里试一下吧!

来自远方的panda这水车....等会,岛三的模型什么时候可以斜着了
点赞0
评论
早都可以了)
我是说建模型的小格子,这要是是建好模型拼上去的那真的牛啤()()()
???
水车模型应该是拼接上去的
拼好然后再打组()
对((
拼的()斜着的都是()
星星上的雪花
点赞1
评论
【高清原图】https://static.box3.codemao.cn/block/QmYb4hkooRXuTNMJwryZVYhtLNoUX33MwEG6n3y9mVzxKW..png
这是哪个地图啊@w@
叫《大世界地图》,今天白天都还在的,下午吉吉喵给删了,链接:https://box3.codemao.cn/p/7ff038045bb791af976a,现在你进去也玩不了,就只有这张截图
全是模型
喵的吉吉
这是原神的蒙德城吗?
有可能是
蒙德没有水车()((
https://box3.codemao.cn/p/7ff038045bb791af976a
这个是真的强()