Jump to content

THREE.js Particle engine


lenacus
 Share

Recommended Posts

Hi everybody,

 

I have read many tutorials and I start programming with this assistance. Despite this help, I can't make the engine run properly particles. 
 
I have a ship. Currently, it has 1 "reactor" at 0,0,0 and it works very well (view my upload 3.jpg). The SPE is linked with the scene :
 
                reactorGroup = new SPE.Group({                    texture: THREE.ImageUtils.loadTexture('./img/smokeparticle.png'),                    maxAge: 1                });                reactorEmitter = new SPE.Emitter({                    type: 'cube',                    position: ship.position,                    positionSpread: new THREE.Vector3(1, 1, 1),                    sizeStart: 2,                    sizeEnd: 1,                    colorStart: new THREE.Color( 'white' ),                    colorMiddle: new THREE.Color( 'red' ),                    colorEnd: new THREE.Color( 'blue' ),                    opacityStart: 0.05,                    opacityMiddle: 1,                    opacityEnd: 0,                    particleCount: 1000                });						reactorGroup.addEmitter(reactorEmitter);		scene.add( reactorGroup.mesh );
 
Now I would like to shift the engine on the x axis and y (view my upload 4.jpg).
 
If I attach the particles to the scene, the position is incorrect when moving (view my upload 1.jpg). 
 
So the problem is that if I attach the particles to the ship with  ship.add( reactorGroup.mesh ); the particle has no effect. And if I attach the particles to the scene, the position is incorrect when moving. 
 
 
Can you help me please ?
thanks.

post-9964-0-93607300-1407065929.jpg

post-9964-0-09845800-1407065980.jpg

post-9964-0-58079500-1407066482.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...