what would be best general way to approach this?

Blitz3D Forums/Blitz3D Beginners Area/what would be best general way to approach this?

timmport(Posted 2006) [#1]
I have an idea for something that I would like to do. Because I am new to Blitz programming I am wondering if I have the general idea about how to approach this.

I would like to create an assempbly line. A pipe(a mesh) would drip objects (will look like clay) onto a conveyor belt(also a mesh). When each object makes contact with the conveyor belt the object will translate down the length of the conveyor.

For the dripping pipe I would make a particle system that would release a single particle at regular intervals. When each particle makes contact with the conveyor it will be parented to some type of invisible repeating transform entity for a short period of time.

Any suggestions about the best way to approach this would be appreciated.

Can someone point me to a tutorial on particles. I have looked all through the forums and code archives?


b32(Posted 2006) [#2]
I think you could maybe use an animated mesh for dripping the clay-like objects. First, place the clay mesh in the pipe. Then start the animation. When it hits the belt, pause the animation and start moving the object along with the belt. I've never used particles but why not use Types ?


D4NM4N(Posted 2006) [#3]
What heppens to the blob when its on the conveyor, does it turn into something else?

The way id do it is using types as bram suggested, a particle system is kind of the same thing, or atleast done in the same way.

A very basic "particle system". This is outa my head so sont expect it to work :P


;mainloop
repeat
  if newdrop_needed add_drop()

  updatedrops()

  updateworld
  renderworld
  flip
until


function add_drop()
     d.drop=new drop
     d\h%=meshhandle
     d\x#=drops_startx
     d\y#=drops_starty
     d\z#=drops_startz
     d\dropvelocity_Y# = 0
     d.onconveryor%=false
endif

function updatedrops()
  for d.drop=each drops
      if dropcollided then;(dosome kind of collision/pick to get this)
         animate d\drop ;possible splat anim
         d\onconveyor=true
         d\dropvelocityY=0
         rotateentity d\h,(direction of conveyor)
      else
         d\dropvelocity=d\dropvelocity_Y + gravity#;needs setting up to a suitable value, try 0.01
     endif  
     
     
     if d\onconveyor moveentity d\h,0,0,beltspeed

     translateentity d\h,0,-d\velocity_Y,0;move ent down by gravity regardless of orientation

     if dropnolongerneeded;ie off screen
         assasinate_drop(d.drop)
     endif

  next
end function

function assasinate_drop(d.drop)
   freeentity d\h
   delete d
endif




markcw(Posted 2006) [#4]
hi, designing a particle system takes a lot of time. i would recommend you first have a good look at the particle systems on offer in the toolbox.

http://www.blitzbasic.com/toolbox/toolbox.php?cat=15

I have pyroparticlesystem, so i would recommend that but there is also particlesworks which may be as good/better. I tried Rottparticles but it has no examples/help. There are many others there too.


timmport(Posted 2006) [#5]
I will look at the amnimated mesh, types and the particles system tool. What would types be used for in this situation? Also how should I go about moving the objects on the conveyor once it drips down onto the conveyor? Does anyone think this aspect would involve parenting the object to some type of invisible moving parent?
Thanks


D4NM4N(Posted 2006) [#6]
just load your drop mesh and then hide it.
eg at the start do:
sourcemesh=loadmesh("whatever.x")
hideentity sourcemesh

Then (if using the code above) change the line in add_drop to:
d\h%=copyentity(sourcemesh)

copy entity simply creates an instance or ghost copy of the mesh, that still relies on its original.

I think parenting in this case would be unnecassary