Upload preprocess_manual.js
Browse files- preprocess_manual.js +307 -8
preprocess_manual.js
CHANGED
|
@@ -2414,7 +2414,312 @@ function setupBoneAssignment(ui, scene, camera, renderer, gvrm, character, filte
|
|
| 2414 |
}
|
| 2415 |
});
|
| 2416 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2417 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2418 |
// ========================================
|
| 2419 |
// Statistics Update
|
| 2420 |
// ========================================
|
|
@@ -2471,9 +2776,7 @@ function setupBoneAssignment(ui, scene, camera, renderer, gvrm, character, filte
|
|
| 2471 |
// ========================================
|
| 2472 |
// Raycaster Setup
|
| 2473 |
// ========================================
|
| 2474 |
-
|
| 2475 |
-
const raycaster = new THREE.Raycaster();
|
| 2476 |
-
const mouse = new THREE.Vector2();
|
| 2477 |
|
| 2478 |
//////挿入箇所start
|
| 2479 |
|
|
@@ -2672,9 +2975,6 @@ function findNearestSplatWithRadius(mouseX, mouseY, camera, filteredGs, brushRad
|
|
| 2672 |
// マウスクリック/ドラッグイベント処理の改善例
|
| 2673 |
// ========================================
|
| 2674 |
|
| 2675 |
-
// グローバル変数
|
| 2676 |
-
let lastPaintMouseX = null;
|
| 2677 |
-
let lastPaintMouseY = null;
|
| 2678 |
|
| 2679 |
// マウスダウンイベント
|
| 2680 |
renderer.domElement.addEventListener('mousedown', (event) => {
|
|
@@ -2801,8 +3101,7 @@ function applyAssignmentToIndices(indices, target, isEraser) {
|
|
| 2801 |
// 球体選択モード(元のコード互換)
|
| 2802 |
// ========================================
|
| 2803 |
|
| 2804 |
-
|
| 2805 |
-
const selectSphereBtn = document.getElementById('select-sphere-btn');
|
| 2806 |
|
| 2807 |
if (selectSphereBtn) {
|
| 2808 |
selectSphereBtn.addEventListener('click', () => {
|
|
|
|
| 2414 |
}
|
| 2415 |
});
|
| 2416 |
}
|
| 2417 |
+
////helper関数挿入
|
| 2418 |
+
|
| 2419 |
+
// ========================================
|
| 2420 |
+
// 完全なペイント・選択機能
|
| 2421 |
+
// "// ========================================
|
| 2422 |
+
// // Selection Radius
|
| 2423 |
+
// // ========================================"
|
| 2424 |
+
// の直後に追加してください
|
| 2425 |
+
// ========================================
|
| 2426 |
+
|
| 2427 |
+
// ========================================
|
| 2428 |
+
// Raycaster と マウスイベント
|
| 2429 |
+
// ========================================
|
| 2430 |
+
const raycaster = new THREE.Raycaster();
|
| 2431 |
+
const mouse = new THREE.Vector2();
|
| 2432 |
+
|
| 2433 |
+
/**
|
| 2434 |
+
* 2D画面座標から最も近い3D Splatを検索
|
| 2435 |
+
*/
|
| 2436 |
+
function findNearestSplat(mouseX, mouseY, camera, filteredGs, maxScreenDistance = 100) {
|
| 2437 |
+
console.log('[findNearestSplat] Searching for splat near mouse:', { mouseX, mouseY });
|
| 2438 |
+
|
| 2439 |
+
const canvas = renderer.domElement;
|
| 2440 |
+
const mousePixelX = (mouseX + 1) * canvas.width / 2;
|
| 2441 |
+
const mousePixelY = (-mouseY + 1) * canvas.height / 2;
|
| 2442 |
+
|
| 2443 |
+
let nearestSplatIndex = -1;
|
| 2444 |
+
let nearestScreenDist = Infinity;
|
| 2445 |
+
let nearestWorldDist = Infinity;
|
| 2446 |
+
|
| 2447 |
+
const cameraPos = camera.position;
|
| 2448 |
+
const worldPos = new THREE.Vector3();
|
| 2449 |
+
const screenPos = new THREE.Vector3();
|
| 2450 |
+
|
| 2451 |
+
for (let i = 0; i < filteredGs.splatCount; i++) {
|
| 2452 |
+
worldPos.x = filteredGs.centers0[i * 3 + 0];
|
| 2453 |
+
worldPos.y = filteredGs.centers0[i * 3 + 1];
|
| 2454 |
+
worldPos.z = filteredGs.centers0[i * 3 + 2];
|
| 2455 |
+
|
| 2456 |
+
screenPos.copy(worldPos);
|
| 2457 |
+
screenPos.project(camera);
|
| 2458 |
+
|
| 2459 |
+
if (screenPos.z > 1) continue;
|
| 2460 |
+
|
| 2461 |
+
const screenPixelX = (screenPos.x + 1) * canvas.width / 2;
|
| 2462 |
+
const screenPixelY = (-screenPos.y + 1) * canvas.height / 2;
|
| 2463 |
+
|
| 2464 |
+
const dx = screenPixelX - mousePixelX;
|
| 2465 |
+
const dy = screenPixelY - mousePixelY;
|
| 2466 |
+
const screenDist = Math.sqrt(dx * dx + dy * dy);
|
| 2467 |
+
|
| 2468 |
+
if (screenDist < maxScreenDistance && screenDist < nearestScreenDist) {
|
| 2469 |
+
nearestScreenDist = screenDist;
|
| 2470 |
+
nearestSplatIndex = i;
|
| 2471 |
+
|
| 2472 |
+
const worldDx = worldPos.x - cameraPos.x;
|
| 2473 |
+
const worldDy = worldPos.y - cameraPos.y;
|
| 2474 |
+
const worldDz = worldPos.z - cameraPos.z;
|
| 2475 |
+
nearestWorldDist = Math.sqrt(worldDx * worldDx + worldDy * worldDy + worldDz * worldDz);
|
| 2476 |
+
}
|
| 2477 |
+
}
|
| 2478 |
+
|
| 2479 |
+
if (nearestSplatIndex >= 0) {
|
| 2480 |
+
console.log('[findNearestSplat] ✓ Found nearest splat:', {
|
| 2481 |
+
index: nearestSplatIndex,
|
| 2482 |
+
screenDistance: nearestScreenDist.toFixed(1) + 'px',
|
| 2483 |
+
worldDistance: nearestWorldDist.toFixed(3) + 'm'
|
| 2484 |
+
});
|
| 2485 |
+
|
| 2486 |
+
return {
|
| 2487 |
+
index: nearestSplatIndex,
|
| 2488 |
+
screenDistance: nearestScreenDist,
|
| 2489 |
+
worldDistance: nearestWorldDist
|
| 2490 |
+
};
|
| 2491 |
+
}
|
| 2492 |
+
|
| 2493 |
+
console.log('[findNearestSplat] ✗ No splat found within', maxScreenDistance, 'px');
|
| 2494 |
+
return null;
|
| 2495 |
+
}
|
| 2496 |
+
|
| 2497 |
+
/**
|
| 2498 |
+
* 球体範囲内の全Splatを検索
|
| 2499 |
+
*/
|
| 2500 |
+
function findSplatsInSphere(center, radius, filteredGs) {
|
| 2501 |
+
const indicesInSphere = [];
|
| 2502 |
+
const radiusSquared = radius * radius;
|
| 2503 |
+
|
| 2504 |
+
for (let i = 0; i < filteredGs.splatCount; i++) {
|
| 2505 |
+
const x = filteredGs.centers0[i * 3 + 0];
|
| 2506 |
+
const y = filteredGs.centers0[i * 3 + 1];
|
| 2507 |
+
const z = filteredGs.centers0[i * 3 + 2];
|
| 2508 |
+
|
| 2509 |
+
const dx = x - center.x;
|
| 2510 |
+
const dy = y - center.y;
|
| 2511 |
+
const dz = z - center.z;
|
| 2512 |
+
const distSquared = dx * dx + dy * dy + dz * dz;
|
| 2513 |
+
|
| 2514 |
+
if (distSquared <= radiusSquared) {
|
| 2515 |
+
indicesInSphere.push(i);
|
| 2516 |
+
}
|
| 2517 |
+
}
|
| 2518 |
+
|
| 2519 |
+
console.log('[findSplatsInSphere] Found', indicesInSphere.length, 'splats within radius', radius.toFixed(2), 'm');
|
| 2520 |
+
return indicesInSphere;
|
| 2521 |
+
}
|
| 2522 |
+
|
| 2523 |
+
/**
|
| 2524 |
+
* ペイントモード用: マウスパスに沿ってSplatを塗る
|
| 2525 |
+
*/
|
| 2526 |
+
function findSplatsAlongMousePath(mouseX, mouseY, lastMouseX, lastMouseY, camera, filteredGs, brushRadius = 30) {
|
| 2527 |
+
const affectedSplats = new Set();
|
| 2528 |
+
|
| 2529 |
+
const steps = 5;
|
| 2530 |
+
for (let step = 0; step <= steps; step++) {
|
| 2531 |
+
const t = step / steps;
|
| 2532 |
+
const interpX = lastMouseX + (mouseX - lastMouseX) * t;
|
| 2533 |
+
const interpY = lastMouseY + (mouseY - lastMouseY) * t;
|
| 2534 |
+
|
| 2535 |
+
const result = findNearestSplatWithRadius(interpX, interpY, camera, filteredGs, brushRadius);
|
| 2536 |
+
if (result && result.indices) {
|
| 2537 |
+
result.indices.forEach(idx => affectedSplats.add(idx));
|
| 2538 |
+
}
|
| 2539 |
+
}
|
| 2540 |
+
|
| 2541 |
+
return Array.from(affectedSplats);
|
| 2542 |
+
}
|
| 2543 |
+
|
| 2544 |
+
/**
|
| 2545 |
+
* ブラシ半径内の全Splatを返す
|
| 2546 |
+
*/
|
| 2547 |
+
function findNearestSplatWithRadius(mouseX, mouseY, camera, filteredGs, brushRadius) {
|
| 2548 |
+
const canvas = renderer.domElement;
|
| 2549 |
+
const mousePixelX = (mouseX + 1) * canvas.width / 2;
|
| 2550 |
+
const mousePixelY = (-mouseY + 1) * canvas.height / 2;
|
| 2551 |
+
|
| 2552 |
+
const affectedIndices = [];
|
| 2553 |
+
const worldPos = new THREE.Vector3();
|
| 2554 |
+
const screenPos = new THREE.Vector3();
|
| 2555 |
+
|
| 2556 |
+
for (let i = 0; i < filteredGs.splatCount; i++) {
|
| 2557 |
+
worldPos.x = filteredGs.centers0[i * 3 + 0];
|
| 2558 |
+
worldPos.y = filteredGs.centers0[i * 3 + 1];
|
| 2559 |
+
worldPos.z = filteredGs.centers0[i * 3 + 2];
|
| 2560 |
+
|
| 2561 |
+
screenPos.copy(worldPos);
|
| 2562 |
+
screenPos.project(camera);
|
| 2563 |
+
|
| 2564 |
+
if (screenPos.z > 1) continue;
|
| 2565 |
+
|
| 2566 |
+
const screenPixelX = (screenPos.x + 1) * canvas.width / 2;
|
| 2567 |
+
const screenPixelY = (-screenPos.y + 1) * canvas.height / 2;
|
| 2568 |
+
|
| 2569 |
+
const dx = screenPixelX - mousePixelX;
|
| 2570 |
+
const dy = screenPixelY - mousePixelY;
|
| 2571 |
+
const screenDist = Math.sqrt(dx * dx + dy * dy);
|
| 2572 |
+
|
| 2573 |
+
if (screenDist < brushRadius) {
|
| 2574 |
+
affectedIndices.push(i);
|
| 2575 |
+
}
|
| 2576 |
+
}
|
| 2577 |
+
|
| 2578 |
+
return affectedIndices.length > 0 ? { indices: affectedIndices } : null;
|
| 2579 |
+
}
|
| 2580 |
+
|
| 2581 |
+
// ========================================
|
| 2582 |
+
// マウスイベント処理
|
| 2583 |
+
// ========================================
|
| 2584 |
+
|
| 2585 |
+
let lastPaintMouseX = null;
|
| 2586 |
+
let lastPaintMouseY = null;
|
| 2587 |
+
|
| 2588 |
+
renderer.domElement.addEventListener('mousedown', (event) => {
|
| 2589 |
+
if (!isPaintMode || !selectedTarget) return;
|
| 2590 |
+
|
| 2591 |
+
isPainting = true;
|
| 2592 |
+
paintModeEraser = event.shiftKey;
|
| 2593 |
+
|
| 2594 |
+
const rect = renderer.domElement.getBoundingClientRect();
|
| 2595 |
+
mouse.x = ((event.clientX - rect.left) / rect.width) * 2 - 1;
|
| 2596 |
+
mouse.y = -((event.clientY - rect.top) / rect.height) * 2 + 1;
|
| 2597 |
+
|
| 2598 |
+
lastPaintMouseX = mouse.x;
|
| 2599 |
+
lastPaintMouseY = mouse.y;
|
| 2600 |
+
|
| 2601 |
+
// 最初のクリック位置でペイント
|
| 2602 |
+
handlePaintAtPosition(mouse.x, mouse.y);
|
| 2603 |
+
});
|
| 2604 |
+
|
| 2605 |
+
renderer.domElement.addEventListener('mousemove', (event) => {
|
| 2606 |
+
if (!isPainting || !isPaintMode) return;
|
| 2607 |
+
|
| 2608 |
+
const rect = renderer.domElement.getBoundingClientRect();
|
| 2609 |
+
mouse.x = ((event.clientX - rect.left) / rect.width) * 2 - 1;
|
| 2610 |
+
mouse.y = -((event.clientY - rect.top) / rect.height) * 2 + 1;
|
| 2611 |
+
|
| 2612 |
+
// パスに沿ってペイント
|
| 2613 |
+
const affectedIndices = findSplatsAlongMousePath(
|
| 2614 |
+
mouse.x, mouse.y,
|
| 2615 |
+
lastPaintMouseX, lastPaintMouseY,
|
| 2616 |
+
camera, filteredGs,
|
| 2617 |
+
30 // ブラシ半径30px
|
| 2618 |
+
);
|
| 2619 |
+
|
| 2620 |
+
if (affectedIndices.length > 0) {
|
| 2621 |
+
applyAssignmentToIndices(affectedIndices, selectedTarget, paintModeEraser);
|
| 2622 |
+
}
|
| 2623 |
+
|
| 2624 |
+
lastPaintMouseX = mouse.x;
|
| 2625 |
+
lastPaintMouseY = mouse.y;
|
| 2626 |
+
});
|
| 2627 |
+
|
| 2628 |
+
renderer.domElement.addEventListener('mouseup', () => {
|
| 2629 |
+
isPainting = false;
|
| 2630 |
+
lastPaintMouseX = null;
|
| 2631 |
+
lastPaintMouseY = null;
|
| 2632 |
+
});
|
| 2633 |
+
|
| 2634 |
+
/**
|
| 2635 |
+
* ペイント処理を実行
|
| 2636 |
+
*/
|
| 2637 |
+
function handlePaintAtPosition(mouseX, mouseY) {
|
| 2638 |
+
const result = findNearestSplatWithRadius(mouseX, mouseY, camera, filteredGs, 30);
|
| 2639 |
+
|
| 2640 |
+
if (result && result.indices.length > 0) {
|
| 2641 |
+
applyAssignmentToIndices(result.indices, selectedTarget, paintModeEraser);
|
| 2642 |
+
} else {
|
| 2643 |
+
console.log('[Paint] No splats found under cursor');
|
| 2644 |
+
}
|
| 2645 |
+
}
|
| 2646 |
+
|
| 2647 |
+
// ========================================
|
| 2648 |
+
// 球体選択ボタン
|
| 2649 |
+
// ========================================
|
| 2650 |
+
|
| 2651 |
+
const selectSphereBtn = document.getElementById('select-sphere-btn');
|
| 2652 |
+
|
| 2653 |
+
if (selectSphereBtn) {
|
| 2654 |
+
selectSphereBtn.addEventListener('click', () => {
|
| 2655 |
+
if (!selectedTarget) {
|
| 2656 |
+
alert('Please select a target bone or group first!');
|
| 2657 |
+
return;
|
| 2658 |
+
}
|
| 2659 |
+
|
| 2660 |
+
selectionMode = 'sphere';
|
| 2661 |
+
console.log('[Sphere Selection] Mode activated, radius:', selectionRadius, 'm');
|
| 2662 |
+
console.log('[Sphere Selection] Click on a splat to select all nearby splats');
|
| 2663 |
+
|
| 2664 |
+
const onSphereClick = (event) => {
|
| 2665 |
+
const rect = renderer.domElement.getBoundingClientRect();
|
| 2666 |
+
mouse.x = ((event.clientX - rect.left) / rect.width) * 2 - 1;
|
| 2667 |
+
mouse.y = -((event.clientY - rect.top) / rect.height) * 2 + 1;
|
| 2668 |
+
|
| 2669 |
+
// ⭐ 改善: 最も近いsplatを見つける
|
| 2670 |
+
const nearestResult = findNearestSplat(mouse.x, mouse.y, camera, filteredGs, 100);
|
| 2671 |
+
|
| 2672 |
+
if (!nearestResult) {
|
| 2673 |
+
alert('No splat found near click. Please click closer to the object.');
|
| 2674 |
+
renderer.domElement.removeEventListener('click', onSphereClick);
|
| 2675 |
+
selectionMode = null;
|
| 2676 |
+
return;
|
| 2677 |
+
}
|
| 2678 |
+
|
| 2679 |
+
const centerIdx = nearestResult.index;
|
| 2680 |
+
|
| 2681 |
+
const centerX = filteredGs.centers0[centerIdx * 3 + 0];
|
| 2682 |
+
const centerY = filteredGs.centers0[centerIdx * 3 + 1];
|
| 2683 |
+
const centerZ = filteredGs.centers0[centerIdx * 3 + 2];
|
| 2684 |
+
const center = new THREE.Vector3(centerX, centerY, centerZ);
|
| 2685 |
+
|
| 2686 |
+
console.log('[Sphere Selection] Center splat:', centerIdx, 'at', center);
|
| 2687 |
+
|
| 2688 |
+
const indicesInSphere = findSplatsInSphere(center, selectionRadius, filteredGs);
|
| 2689 |
+
|
| 2690 |
+
if (indicesInSphere.length === 0) {
|
| 2691 |
+
alert('No splats found in sphere. Try increasing the radius.');
|
| 2692 |
+
renderer.domElement.removeEventListener('click', onSphereClick);
|
| 2693 |
+
selectionMode = null;
|
| 2694 |
+
return;
|
| 2695 |
+
}
|
| 2696 |
+
|
| 2697 |
+
applyAssignmentToIndices(indicesInSphere, selectedTarget, false);
|
| 2698 |
|
| 2699 |
+
assignmentData.history.push({
|
| 2700 |
+
action: 'sphere_select',
|
| 2701 |
+
indices: [...indicesInSphere],
|
| 2702 |
+
target: selectedTarget
|
| 2703 |
+
});
|
| 2704 |
+
|
| 2705 |
+
console.log('[Sphere Selection] Completed:', indicesInSphere.length, 'splats assigned');
|
| 2706 |
+
|
| 2707 |
+
renderer.domElement.removeEventListener('click', onSphereClick);
|
| 2708 |
+
selectionMode = null;
|
| 2709 |
+
};
|
| 2710 |
+
|
| 2711 |
+
renderer.domElement.addEventListener('click', onSphereClick);
|
| 2712 |
+
});
|
| 2713 |
+
}
|
| 2714 |
+
|
| 2715 |
+
console.log('[setupBoneAssignment] ✓ Improved splat selection system initialized');
|
| 2716 |
+
console.log('[setupBoneAssignment] Features:');
|
| 2717 |
+
console.log(' - Finds nearest splat within 100px');
|
| 2718 |
+
console.log(' - Paint mode with drag support');
|
| 2719 |
+
console.log(' - Smooth brush strokes with interpolation');
|
| 2720 |
+
console.log(' - Sphere selection with improved center detection');
|
| 2721 |
+
|
| 2722 |
+
////helper関数挿入
|
| 2723 |
// ========================================
|
| 2724 |
// Statistics Update
|
| 2725 |
// ========================================
|
|
|
|
| 2776 |
// ========================================
|
| 2777 |
// Raycaster Setup
|
| 2778 |
// ========================================
|
| 2779 |
+
|
|
|
|
|
|
|
| 2780 |
|
| 2781 |
//////挿入箇所start
|
| 2782 |
|
|
|
|
| 2975 |
// マウスクリック/ドラッグイベント処理の改善例
|
| 2976 |
// ========================================
|
| 2977 |
|
|
|
|
|
|
|
|
|
|
| 2978 |
|
| 2979 |
// マウスダウンイベント
|
| 2980 |
renderer.domElement.addEventListener('mousedown', (event) => {
|
|
|
|
| 3101 |
// 球体選択モード(元のコード互換)
|
| 3102 |
// ========================================
|
| 3103 |
|
| 3104 |
+
|
|
|
|
| 3105 |
|
| 3106 |
if (selectSphereBtn) {
|
| 3107 |
selectSphereBtn.addEventListener('click', () => {
|