Closed comger closed 6 years ago
var hit = scene.pick({ pickSurface: true, canvasPos: [23, 131] });
if (hit) { // Picked an Entity
var entity = hit.entity;
var primitive = hit.primitive; // Type of primitive that was picked, usually "triangles"
var primIndex = hit.primIndex; // Position of triangle's first index in the picked Entity's Geometry's indices array
var indices = hit.indices; // UInt32Array containing the triangle's vertex indices
var localPos = hit.localPos; // Float32Array containing the picked Local-space position on the triangle
var worldPos = hit.worldPos; // Float32Array containing the picked World-space position on the triangle
var viewPos = hit.viewPos; // Float32Array containing the picked View-space position on the triangle
var bary = hit.bary; // Float32Array containing the picked barycentric position within the triangle
var normal = hit.normal; // Float32Array containing the interpolated normal vector at the picked position on the triangle
var uv = hit.uv; // Float32Array containing the interpolated UV coordinates at the picked position on the triangle
}
how to get world point when i do a custom click? like clientToWorld or screenToWorld; and how to project the world point by camera when camera change.