roland
December 2, 2022, 12:44pm
4
@carolhmj I started to implement raycasting for the GreasedLine
. It’s a ThreeJS port so it was easier for me to verify the raycast algorithm by implementing all the underlying ThreeJS methods I couldn’t find in BabylonJS If someone can give me hints how to do all the math using already available BabylonJS methods, it would be damn cool!
Thanks!
R.
Hi my friends!
EDIT:
You can find the docs here. The examples released before July 2023 are obsolete.
Creating A GreasedLine | Babylon.js Documentation
I started to work on porting the THREE.MeshLine code to BabylonJS and the first version is already working. With MeshLine you can draw cool lines with a tons customizations available and all this happens on the GPU.
I’d like to ask the community to which way should I move on further? Do we want the MeshLine extend a Mesh? Now there is Mesh…
import { Vector3 } from './Vector3.js';
const _vector = /*@__PURE__*/ new Vector3();
const _segCenter = /*@__PURE__*/ new Vector3();
const _segDir = /*@__PURE__*/ new Vector3();
const _diff = /*@__PURE__*/ new Vector3();
const _edge1 = /*@__PURE__*/ new Vector3();
const _edge2 = /*@__PURE__*/ new Vector3();
const _normal = /*@__PURE__*/ new Vector3();
class Ray {
constructor( origin = new Vector3(), direction = new Vector3( 0, 0, - 1 ) ) {
this.origin = origin;
this.direction = direction;
}
This file has been truncated. show original
1 Like