能否请您解释一下Autodesk forge中用于旋转组件(节点)的c#html代码。
我正在使用点网核心2.2
答案 0 :(得分:0)
可以使用THREE.js库(基于WebGL的图形API,了解更多信息here)以纯JavaScript进行转换,因此.NET不适合您的目标。请参见下面的示例代码(完整示例here):
let dbid = viewer.getSelection(); //make sure you point to the root node of target component
let tree = viewer.model.getData().instanceTree; //obtain model object tree
tree.enumNodeFragments(dbid, function (frag) {
var fragProxy = viewer.impl.getFragmentProxy(viewer.model, frag);
fragProxy.getAnimTransform();
fragProxy.quaternion = new THREE.Quaternion().setFromAxisAngle(
new THREE.Vector3(1,0,0),
-Math.PI/2); //spin the component by 90 degrees
fragProxy.updateAnimTransform(); //notify fragment proxy to perform animation
});
viewer.impl.sceneUpdated(true); //notify Viewer to update scene
有关如何转换组件的详细信息,请参见here。