-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
I'm trying to get your "Collisions" example to work with a different shape rather than the IcosahedronGeometry.
I've loaded in a geometry yet the particles still bounce off a sphere shape at the same position. How can i map my geometry uniforms to the collider?
If that makes sense. err..
Heres what i have (the main part of it):
var loader = new THREE.JSONLoader();
loader.load('./resources/crystal.json', function (geometry, materials) {
var material = new THREE.MeshNormalMaterial({
transparent: true,
opacity: 1
});
model = new THREE.Mesh(geometry, material);
scene.add(model)
simulationUniforms.colliderPositions.value.push( model.position );
var numOf = simulationUniforms.colliderPositions.value.length;
var ss = shaders.setValue( shaders.ss.sim , 'COLLIDERS' , numOf );
simulation = new PhysicsRenderer( SIZE , ss , renderer );
var geo = createLookupGeometry( SIZE );
var mat = new THREE.ShaderMaterial({
uniforms: renderUniforms,
vertexShader: shaders.vs.lookup,
fragmentShader: shaders.fs.lookup,
blending: THREE.AdditiveBlending,
transparent: true
});
simulation.setUniforms( simulationUniforms );
var particles = new THREE.PointCloud( geo , mat );
particles.frustumCulled = false;
scene.add( particles );
simulation.addBoundTexture( renderUniforms.t_pos , 'output' );
simulation.resetRand( 5 );
animate();
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels