Welcome, Guest
Want to take part in these discussions? Sign in if you have an account, or apply for one below
-
- CommentAuthorltpve74
- CommentTimeSep 21st 2010
Hi,
I am definitely new to flint and away3d, I am trying to achieve a fountain of photographs in 3d I have so far managed to create the particles with a custom 3d object which will be my photographs.
I am having trouble figuring out how to make it so that the photographs are pointing to the centre of the fountain when they get generated, at the moment all of them are angled in the same direction. I would like to angle them so that they point towards the centre.
also would it be possible for the Plane to follow the direction it is travelling? in other words the plane would lay flat when it is at the top at the fountain but would then follow the curve and therefore go down sideways?
I hope I managed to explain myself.
thanks for any help
Luigi -
- CommentAuthorRichard
- CommentTimeSep 21st 2010
The RotateToDirection action may do what you need. -
- CommentAuthorltpve74
- CommentTimeSep 21st 2010
Hi,
RotateToDirection does do something but it makes my planes flip all over the place.
how do I make so that the planes are generated pointed at the center of the fountain? the fountain needs to be seen from the top and the photographs need to be generated in a circular pattern.
thanks -
- CommentAuthorRichard
- CommentTimeSep 21st 2010
You probably need to create a custom action for that. -
- CommentAuthorltpve74
- CommentTimeSep 21st 2010
what does TurnTowardsPoint do and can it be used to turn the objects3d towards the centre? -
- CommentAuthorRichard
- CommentTimeSep 23rd 2010
As the documentation says "The TurnTowardsPoint action causes the particle to constantly adjust its direction so that it travels towards a particular point." It doesn't alter the rotation, just the direction of travel. -
- CommentAuthorltpve74
- CommentTimeSep 23rd 2010
Hi Richard,
I have now managed to rotate the particles plane towards the centre and things are taking shape.
I do have another question though, is it possible to now interact with the particle? in other words I would like to user to be able to pick up the photograph and drag it around.
I guess in somehow I have to stop the emitter or renderer from interacting with the particle in question, is there a way to do that?
thanks
Luigi -
- CommentAuthorRichard
- CommentTimeSep 23rd 2010 edited
I'm realising that the Emitter needs a "removeParticle" method. Until that happens, you need the particles property of the emitter, which is the actual array of particles used by the emitter. Remove the particle from this array and the emitter will no longer control it. When you want to add the particle back either add it directly to the particles array or use the addExistingParticles() method of the emitter. -
- CommentAuthorltpve74
- CommentTimeSep 24th 2010
Hi Richard,
ok so working towards this, if I put a mouseDown event in my class for the particle, it does respond. I am thinking I need to create and event that the emitter would listen to so the particle can let the emitter know that it needs to be deleted from the array.
I tried this with a custom event but the emitter never receives the event even though the event is set to bubble. where is the particle created in relation to the emitter?
I also tried to ues ADDED_TO_STAGE but when the particle is created it never gets added to the stage, is this because I ma using away3d to handle the rendering of the particles?
am I even going in the right direction with this?
regards
luigi -
- CommentAuthorRichard
- CommentTimeSep 24th 2010
Neither the emitter nor the particle are display objects. The only display objects, or sorts, are the particle images, stored in the image property of each particle, which in your case are Away3D objects (Object3D) so not normal display objects anyway. My inclination would be to create a separate object that listens for the events on the particles' images and takes the necessary action, but I don't know the details of your implementation. -
- CommentAuthorltpve74
- CommentTimeSep 27th 2010
Hi,
ok I will try the route of an object listening to the events from the particles but could you explain to me how to find the particular particle in the particles array in order to delete so the emitter won't control it anymore? I'm a bit confused about this and this is the last step I need to make it work.
thanks
Luigi -
- CommentAuthorRichard
- CommentTimeSep 28th 2010 edited
If the target of the event is the image of the particle, you'll need to loop through the particles array looking for the particle whose image property matches the event target.var particles:Array = emitter.particles;
var len:int = particles.length;
for( var i:int = 0; i < len; ++i )
{
if( particles[i].image = event.target )
{
particles.splice( i, 1 );
break;
}
}
(N.B. This code isn't tested) -
- CommentAuthorltpve74
- CommentTimeSep 28th 2010
great thanks, i will give it a go and let you know what happens.
L
1 to 13 of 13
