* DONE add interact package

TODO add Input, Picking


* DONE update scenegraph


* DONE gameview-render add OutlinePass 

* DONE gameview-render add related api




* DONE update scenegraph



* DONE script interact api 


* DONE publish and update 


* TODO run test


** DONE picking to print

TODO add getViewRect, setSelectionObjects to script api


** DONE show outline

TODO fix:
select one but select all
    # visible?
    # overrideMaterial?
    id


children gameObject can't be select

add cube when run->event not work in gameview




TODO test glb model


** DONE too slow

TODO optimize:
should first check bounding

get geometry

check only when trigger event



# * TODO fix: cancel load glb
# TODO make add-asset update work!
# * TODO fix: when stop, script asset->event file str not restore immdiatlly




* DONE pass publish engine

TODO web render:
add api
render job:add outline


TODO run test:
publish local
publish to platform


* DONE need update


TODO e,c,p:
# gameview-render e, c and p
# # meta3d-action-run
# interact p
# scenegraph
# event
# three-api p
# ui
# editor e, p
# webview e,c,p
# engine-whole e, p
# web-render

# run
# add asset
# add cube



TODO packages:
# gameview-render
# editor







* DONE 优化: 错误 打印

# use error instead of throw



TODO RunElementVisual:
if error, show error message and continue(loop)


TODO fix:
continue from event data: recursive



TODO e,c,p:
editor-whole
gameview c

run


* DONE learn three.js with keyframe animation

TODO demo


* DONE implement cube keyframe animation

# ** TODO build data


# ** TODO implement

TODO use Tween to move cube

TODO provide animation api



* DONE implement camera keyframe animation to focus cube



TODO compute new target, new distance
    TODO use fake distance

TODO use Tween to these new ones

TODO provide animation api


* DONE fix: if onStop error, recurse throw!

    # TODO fix: if onUpdate error


* DONE fix: onStop ->restore

TODO restore before

TODO onStop not unbind event(because already restore)


* DONE fix: change action->immdiatlly run: action not work



* DONE update engine

TODO fix:animation cube without pick


* DONE publish and update

TODO :
# interact e, p
# gameview c
# editor e

# web-render c

interact

run
stop




* DONE learn ui

TODO use imgui? or ui toolkit?

TODO use echarts to draw table, circle...

TODO use dom?




TODO hud

TODO 3d ui




# * TODO add hud: 2d ui(page) demo


# # TODO use echarts to draw on Sprite
# TODO use echarts to draw on canvas

# # TODO add common 2d ui(e.g. button, text, image, table)

# TODO add event



* DONE 2d ui demo

TODO get template code

TODO use jquery, jquery ui + bootstrap/layui to create page:
Button, Text, Link, echarts



TODO run layui

TODO run echarts

TODO use layui+echarts to render in left panel

TODO use layui to render Modal

TODO Modal add Table, Button, Echart

TODO add event:
add close event


TODO encapulate api:
dom api
event api






TODO run ant design + ant desing charts


TODO run in two root divs


TODO render Modal, Modal add Table, image, link, Button, Echart


TODO add event:
add close event



# * TODO add 3d ui(billboard or face to one direction) demo

# # TODO page box

# TODO text

# TODO link



# TODO show 3d text on the cube by three.js ui


# TODO add event by raycaster



# TODO show 3d text on the cube


# * TODO add 3d board with echarts demo




# * TODO interact add ui api

# TODO merge echarts and 2d ui(echarts's canvas can create in div)


# * TODO pass run test: when click cube1, show echart hud, echart 3d board, page(image, text, link) by 3d ui

* DONE pass run test: when cube1 anim finish, show page Modal(image, text, link); when close Modal, show camera anim


TODO create ui in index.html(publish action)

TODO operate ui in script


TODO compress file


TODO run test:
publish local
# publish to platform




* DONE publish and update

TODO
# publish



# * TODO add data binding

# TODO scene data:
# parent-child cubes
# ids
# description


* DONE finish demo

TODO fix:
not show
add close button
background
close position error
start position error





* DONE publish and update
addcomponent
sceneview c
gameview c

webrender c

imgui

component-script


* DONE fix: remove second script from component not work

* DONE fix: clone gameObject with script component error

* DONE fix: sometimes "can't find editor" error

monaco.editor?

# * TODO perf: switch to element assemble too slow

# TODO publish action?


* DONE fix: engine show dark

fix gamma pass



* DONE default scene remove Arcball_Camera2


* DONE add loading percent, logo

TODO run test:
publish local
# publish to platform




* DONE make canvas's size to be 100%

TODO fix:
ui size
scene bianxing


TODO update demo


TODO publish and update
web-render c


* DONE make demo run in mobile

TODO update
pipeline event

webrender c



** DONE handle mobile event for arcball

** DONE add meta

** DONE handle canvas size

** DONE add vConsole

** DONE ui position and size should match mobile

** DONE host demo to tencent cloud

TODO demo in mobile run test:
show scene
orbit camera
click
show ui


TODO
# can't orbit camera
view aspect error


* DONE improve model

TODO 墙就用白色就可以了，地面就是普通的水泥颜色:
    clone multiple 白墙
    水泥地面平板




* DONE add ambient


* DONE learn code

refer to:
https://www.webglstudy.com/product/200108.html

https://www.grapecity.com.cn/blogs/wyn-3dmodel-bi-analize-data-visualization-solution

[Threejs项目实战](https://juejin.cn/column/7085715244747587591)


* DONE fix in it even though run in pc


* DONE generate model


# ** TODO use CSG to generate wall with window

# refer to:
# https://github.com/samalexander/three-csg-ts



# ** TODO open face cull
# not draw the wall towards camera


** DONE feat: add empty gameObject to scenetree

# ** TODO fix Cube's normal
** DONE fix Cube not affect by ambient


** DONE generate wall models(white)

TODO use Cube as wall


** DONE update ground

use gray color on one plane(cube)


** TODO try create guizi model by a picture by ai

TODO prehandle image(e.g. transparent background, only remain single object in image)

TODO refer to:
https://mmmnote.com/article/7e7/14/article-f3c1080187c93fcd.shtml
https://app.meshy.ai/zh/discover


** TODO try generate guizi model



** TODO try find guizi model

https://www.dhzn3d.com/?cat=&s=%E6%9F%9C





# ** TODO auto generate model by json config

# https://www.cnblogs.com/yeyunfei/p/17756557.html







# * TODO expand warehouse scale



# * TODO move all scripts, ui to published project; only use meta3d editor to build scene!

# TODO move Page out

# TODO scene only has one script:
# invoke script func implemented in published project


# TODO update publish action


# TODO script api add get scene, perspectiveCamera and three api



* TODO add export scene



* TODO add hud as primary(two panel), put canvas in to bottom





* TODO add 3d ui(billboard or face to one direction) demo

# TODO page box

TODO text

TODO link




TODO add event by raycaster




* TODO add 3d ui API

TODO add api to interact package



TODO run test:
show 3d text on the cube by three.js ui



# TODO add to demo



* TODO make camera animation on the line

refer to:
https://www.sohu.com/a/739950864_120719430



TODO add to demo:
add a button as hud;
click button, play camera animation;



* TODO write 系列文章

开源代码！

题目：
# 《数字孪生实战（一）：开篇介绍》
# 《数字孪生实战（二）：使用three.js实现3D仓库（代码开源）》


《three.js数字孪生实战（一）：开始实现3D仓库（代码开源）》
《three.js数字孪生实战（二）：...》

refer to:
https://www.cnblogs.com/yeyunfei/p/7899613.html
https://www.cnblogs.com/xhload3d/p/3475672.html
https://blog.csdn.net/qq_39503511/article/details/112707047
https://juejin.cn/column/7085715244747587591



TODO add jiehuo link!













* TODO future



# ** TODO can edit 2d ui in gameview by script

# debug work flow:
# build 2d ui script;
# run;
# debug 2d ui by edit script;
# save script to temp;
# stop;
# update script;


** TODO add small editors, one integrated big editor

small editors:
model editor(to build a single model)
2D UI editor(to build 2d ui)

data binding editor?



big editor:
integrate small ones!

refer to:
https://www.bilibili.com/video/BV1x2421M7TY/?spm_id_from=trigger_reload&vd_source=9fcdb7c5d92e95429d4dd9af0380937b

https://www.sovitjs.com/index.html

https://www.bilibili.com/video/BV1e24y1t7sH/?spm_id_from=333.788&vd_source=9fcdb7c5d92e95429d4dd9af0380937b

https://www.bilibili.com/video/BV1EK411r7Hx/?vd_source=9fcdb7c5d92e95429d4dd9af0380937b

https://space.bilibili.com/630417024


*** TODO demo

TODO build simple small editors

TODO integrate to big editor




*** TODO add model editor
refer to:
https://www.zhihu.com/question/532065029
https://www.zhihu.com/question/445151365
https://www.zhihu.com/question/536865713



借助场景编辑器的能力，通过自由的模型管理、海量的数字资产以及灵活的三维编辑能力，能实现低成本且高质量地搭建数字孪生项目

自由的模型管理：支持多种格式，卫星遥感影像、倾斜摄影、高程数据、BIM、精细化手工模型数据，另外，城市级模型自动生成，元件几何体拼接，材质贴图管理；海量的数字资产：上千个模型、材质、贴图，上百个场景模版，实现快速构建复用；灵活的三维编辑：沿用市面上成熟通用的三维编辑操作逻辑，涵盖模型吸附、参考线、四格视图.....等三维编辑能力，灵活便捷的工具栏，有效降低用户上手的学习成本，实现快捷编辑。

作者：EasyV数字孪生可视化
链接：https://www.zhihu.com/question/536865713/answer/2763865376
来源：知乎
著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。




perf: if use basic geometrys(e.g. cube, plane), exported glb not has no vertices!






# support procedure texture

support procedural by json config(refer to https://www.cnblogs.com/yeyunfei/p/7899613.html -> b、开始搭建建筑 -> 先创建地板)

support csg(e.g. can generate a wall with hole which can be window, specific shape ground)
    refer to:
        https://www.youtube.com/watch?v=xy2oPBRw-Wc
        https://github.com/samalexander/three-csg-ts
        https://www.hightopo.com/blog/350.html

support procedural model(e.g. [procedural house three.js]( https://www.google.com/search?q=procedural+house+three.js&newwindow=1&sca_esv=e654bb68a3eaa292&sxsrf=ACQVn09Aeh7xlA2fLZN7xqv_cJG5AbJEDQ%3A1710455417987&ei=eXrzZf_sO4bBjuMP0_Wi0AM&ved=0ahUKEwi_jd_85vSEAxWGoGMGHdO6CDoQ4dUDCBA&uact=5&oq=procedural+house+three.js&gs_lp=Egxnd3Mtd2l6LXNlcnAiGXByb2NlZHVyYWwgaG91c2UgdGhyZWUuanMyBRAhGKABSKELUABYngpwAHgAkAEAmAHDAaABwAqqAQMwLji4AQPIAQD4AQGYAgigAtUKwgIHEAAYgAQYE8ICBhAAGB4YE8ICCBAAGAgYHhgTwgIIEAAYBRgeGBPCAgYQABgIGB7CAgcQIRgKGKABmAMAkgcDMC44oAe9EA&sclient=gws-wiz-serp ))

can edit material,texture props(e.g. texture's wrapS/T, material's color)

add export/import single model
# add export/import single model json config
#     this is useful(optimize: improve loading speed; can use instance to draw;) to a whole scene model!
#     refer to: https://www.cnblogs.com/yeyunfei/p/17756557.html -> json配置




integrate 2d to 3d ai model(or just give link)



TODO prepare many units(by load or procedura), then select some and build to one model



TODO run test:
build wall
build ground
build warehouse(wall + ground)

build body
build drawer
build cabinet(body + drawer)

# scene editor(to build a asset bundle for one scene)(add in the future when support AssetBundle!)
#     support mark instance to draw(add instance component)



*** TODO add data binding editor




*** TODO add material editor
TODO support procedure texture

TODO 建材质库
e.g. includes metal、wood...

refer to:
https://zhuanlan.zhihu.com/p/46686345
https://www.google.com/search?q=%E6%9D%90%E8%B4%A8%E7%BC%96%E8%BE%91%E5%99%A8&oq=%E6%9D%90%E8%B4%A8%E7%BC%96%E8%BE%91%E5%99%A8&gs_lcrp=EgZjaHJvbWUyBggAEEUYOdIBCDE3NDlqMGo3qAIAsAIA&sourceid=chrome&ie=UTF-8#ip=1
https://search.bilibili.com/all?keyword=%E5%88%9B%E5%BB%BA%E7%A8%8B%E5%BA%8F%E5%8C%96%E6%9D%90%E8%B4%A8

http://www.archcollege.com/archcollege/2019/07/45050.html

https://www.google.com/search?q=pbr%E6%9D%90%E8%B4%A8+%E6%B5%81%E7%A8%8B&oq=pbr%E6%9D%90%E8%B4%A8+%E6%B5%81%E7%A8%8B&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIKCAEQABiABBiiBDIKCAIQABiABBiiBDIKCAMQABiABBiiBNIBCDE0MjNqMGo3qAIAsAIA&sourceid=chrome&ie=UTF-8





*** TODO add 2d ui editor

TODO add export/import 2d ui

refer to:
https://www.thingjs.com/guide/chartBuilder/
https://www.hightopo.com/blog/3869.html -> 图表操作
https://gitee.com/dromara/go-view
https://juejin.cn/post/6937257727106220040
https://juejin.cn/s/react%20%E5%A4%A7%E5%B1%8F%E5%8F%AF%E8%A7%86%E5%8C%96


try use Ant Design Charts + Ant Design to build ui(based on react):
https://ant-design-charts.antgroup.com/manual/getting-started
https://ant.design/components/input


how to extend by react? refer to:
Wonder-Editor->Extend ui(use react)




TODO build new 2D UI Editor as e1

TODO integrage e1 to current 3d editor:
use iframe to host 3d view?
    https://blog.csdn.net/qq_39816410/article/details/95927232

learn how to integrate?refer to thingjs, integrate https://bbs.huaweicloud.com/blogs/401997#H19 and https://bbs.huaweicloud.com/blogs/401997#H112 :
https://bbs.huaweicloud.com/blogs/401997







TODO handle publish:
e1 editor's output should be a arraybuffer like Scene.arraybuffer!


    TODO pass run test:
    publish local
    # publish to platform


**** TODO update publish to platform refer to publish local


**** TODO refactor: update platform: use @ant-design/charts instead of @ant-design/graphs


** TODO refactor: refactor dom event: change handle to (meta3dState, event)

refer to jiehuo->Event.ts

** TODO picking should return gameObjects instead of objects
** TODO setSelectedObjects should use gameObjects instead of objects
** TODO refactor: rename setSelectedObjects to setSelectedGameObjects




** TODO add transform gizmo

use three.js->transform controls

refer to:
http://localhost:8092/mine/three.js-dev/examples/misc_controls_transform.html


** TODO add Collider component

maintain boundingSphere, boundingBox

TODO computeBounding in update job


TODO update camera focus->new distance


** TODO add Picking component

maintain ray, camera

TODO rewrite setFromCurrentCamera

TODO update intersectScene
    update picking component's data

TODO remove RayCaster


** TODO sceneview add picking



** TODO sceneview add outline



** TODO add MeshRender component

maintain visible



** TODO sceneview add focus when press "f"

*** TODO add hotkey

*** TODO implement focus






** TODO perf: if run many times, memory take much more!

TODO share allocate ECS ArrayBuffers when each run(visual, run)



** TODO add output ui control

show log, error(e.g. error by script->handler)


** TODO GameObjectAPI: add findGameObjectByName


** TODO refactor: move "animation" out of interact package to be animation package



** TODO feat(editor): add ambient by ui control instead of by hard coding

TODO add AmbientLight component

TODO update three render

TODO update Classes->fix AmbientLight



** TODO feat: rewrite FirstPersonControl

TODO refer to flyCameraController but add gravity



** TODO update instance optimize

TODO add instance componenet



# ** TODO can edit 3d ui with echarts in gameview visually



** TODO Script格式优化，像custom一样，支持自定义函数等
将{onInit:xxx} 优化成export let xxx = xxx?

can add util functions!














** TODO add AssetBundle


** TODO add keyframe animation editor



** TODO can edit 3d ui in gameview visually

use [ three-mesh-ui ](https://github.com/felixmariotto/three-mesh-ui)

TODO add 3d ui related components

refer to Unity->UGUI:
https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/index.html




** TODO add Stream Load


** TODO improve small editors





* TODO small improvement

** TODO upgrade three.js version

** TODO fix: camera group can set near, far

** TODO feat: add arcball component; can set distance, phi, theta, target,

** TODO fix: active arcball_forsceneview->publish error

TODO hidden Arcball Camera For Scene View in sceneTree?
