[3D + JS] Layer 제어 Example 2 (Check box)
- 05-05
- 493 회
- 1 건
[member]sahoon[/member]


* Check Box (name :dvectors)
[code]pageIndex = this.pageNum;
annotIndex = 0;
if (getAnnots3D(pageIndex)[0].activated)
{
c3d = getAnnots3D(pageIndex)[0].context3D;
var outcome = this.getField("dvectors").value;
if ( outcome == "Yes" ) c3d.toggleDisplayOfDVectors(true);
else c3d.toggleDisplayOfDVectors(false);
}[/code]
* check.js
[code]const VECTORS = "DVECTOR_";
meshesList = scene.meshes;
var showDisplVectors = true;
var displVectorsList = new Array();
var displVectorsCount = 0;
for (i=0; i<meshesList.count; i++) {
currMesh = meshesList.getByIndex(i);
if ( currMesh.name.indexOf(VECTORS) == 0 ) {
displVectorsList[displVectorsCount] = currMesh;
++displVectorsCount;
}
}
function setVectorsVisible(tag, enable) {
for (i=0; i<displVectorsList.length; i++) {
currMesh = displVectorsList[i];
if ( currMesh.name.indexOf(tag) != -1 ) {
currMesh.visible = enable;
}
}
showDisplVectors = enable;
}
function toggleDisplayOfDVectors() {
showDisplVectors = !showDisplVectors;
setVectorsVisible(VECTORS, showDisplVectors);
}[/code]
- checkbox-dvectors.pdf (522.0K) 2 회
- check.js (771byte) 2 회
- http://sf.anu.edu.au/~vvv900/cct/appl/jmoleditor/manual/tutorials/3d-p… 2 회
- 이전글 [3D + JS] Model 제어 Example (Radio Buttons) 15.05.05
- 다음글 [3D + JS] Model Render Mode Example 15.04.25
