百度智能云AR开放平台使用指南-AR场景开发3D模型渲染 |
百度智能云AR开放平台使用指南-AR场景开发3D模型渲染 3D模型渲染目前引擎在3D方面支持POD类型及GLTF类型的模型渲染。 3D模型制作规范3D模型制作请严格遵守下方提供的 BAR技术3D模型制作规范套装 制作。
模型子节点的获取
-- simple_scene.json文件
{
"name": "bear",
"type": "pod",
"visible": 1,
"touchable": 1,
"meshFileName": "res/model/bear.pod",
"material": {
"common": {
"texturePath":"res/texture/",
"disableLightEffect":0
}
},
"position": "0,300,0",
"scale": "0.3,0.3,0.3",
"rotation": "0,0,0",
"chirlden": [],
"podSuppl": {
"allSubnodeTouchable":1
}
} -- default.lua中需要配置
anim = scene.bear : pod_anim()
:anim_repeat(false)
:on_complete(function()
ARLOG('pod anim done')
end)
:anim_repeat(true)
:start() 模型动画3D模型渲染中,如果仅在simple_scene.json文件中配置模型节点,并设置"visible" : 1,lua文件中未调用模型动画逻辑代码,即只会显示模型,不会执行模型的骨骼动画。 -- 3D渲染(无动画pod模型) json 中节点配置
{
"name": "bear",
"type": "pod",
"visible": 1,
"touchable": 1,
"meshFileName": "res/model/bear.pod",
"material": {
"common": {
"texturePath":"res/texture/",
"disableLightEffect":0
}
},
"position": "0,300,0",
"scale": "0.3,0.3,0.3",
"rotation": "0,0,0",
"chirlden": [],
"podSuppl": {
"allSubnodeTouchable":1
}
}
-- 视频 除json中节点默认配置项外,lua中需要添加的方法
anim = scene.bear:pod_anim()
:anim_repeat(false)
:on_complete(function()
ARLOG('pod anim done')
end)
:anim_repeat(true)
:start() |