sprite rotation vs particle projection on surface

   2362   3   2
User Avatar
Member
20 posts
Joined: Nov. 2016
Offline
Hi

I would like to have group of 2D ants (sprites, or in my case particles projected on flat surface) walking from A to B point.
My problem is math. whats is not in nodes i can't write.
That's why i choice rather project particles on surface because they at least rotate…

Q.1. Could someone point me or explain me how to simply orient sprites to their direction of movement? (don't understand why its not an option). I have seen some threads on ODforum, but they are not to easy to follow.

Q.2. Particles after projection are still rotating in 3d space, how could i lock 2 axis rotation and allow rotation only
around Y?


i attached my try with projection

thanks
Edited by Erikbartos - July 5, 2018 05:40:21

Attachments:
ant.hipnc (623.2 KB)

User Avatar
Member
1737 posts
Joined: May 2006
Online
I've only dabbled with the crowd nodes, but I was able to get a simple setup along the lines you described.

An agent terrain projection is meant to stick crowd characters or particles to a surface, works fairly well.

For orienting the cards that'll have the ant pic, you want 2 vectors, the normal of the surface they're walking on, and the direction they're facing. The terrain projection node provides the first, and the built in @v (velocity) provides the second. Copying the first vector to @N gives the copy to points sop what it needs to fix the cards.

The other things in the setup are nice-to-haves; I tried to make slightly more interesting motion of the particles with a few forces. An axis force pushes the ants away from the start point, a wind adds noise, and 2 interact forces do opposite things; one is a wide soft force to make the ants try and follow each other (sort of), and the other pushes them apart if they get too close.

Attachments:
ants.hip (431.6 KB)
ants.gif (1.0 MB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
20 posts
Joined: Nov. 2016
Offline
Heej wonderful !
I am still surprised how many nodes i haven't even see.

This is absolutely what i needed, you should release tutorial about it many people would find it helpful.

Could you please explain me what is the function of @v = normalize(@P); is it initial velocity from the position?

thanks a lot
User Avatar
Member
1737 posts
Joined: May 2006
Online
Correct. Probably not needed as the axis force pushes the ants away from the centre anyway.
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
  • Quick Links