playMaker

Author Topic: Find Centre of 2 Vector3 points & More complex equation  (Read 1712 times)

eddieq

  • Playmaker Newbie
  • *
  • Posts: 4
Find Centre of 2 Vector3 points & More complex equation
« on: July 21, 2013, 06:14:14 AM »
Hi,

I'm trying to find the center of 2 touch points on the screen.

1. In the Vector3 Operator Action, can there be a Find Centre operator?
2. Can there be a Math Action that deals with more complex equations?

I know the maths is Touch1 + Touch2 / 2, but it seems such a hassle to implement a simple equation like this in Playmaker. In Vector3 Operator I can't seems to easily get the Vector to divide by 2 unless I split the vectors into their X & Y components. Then it will be X1+X2=X3. Then Y1+Y2=Y3. Then X3/2 & Y3/2.
All this for a simple equation.

I'm new to Playmaker, so any help is appreciated.
Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Find Centre of 2 Vector3 points & More complex equation
« Reply #1 on: July 28, 2013, 05:19:45 PM »
Hi,

 one way is the following:

V = V2-V1
V = V*0.5

so here, create a fsm vector 3 variable "V"
V2-V1 is done with the action "Vector3 operator" set to substract and save the result in V
V*0.5 is done with the action "vector3 multiply"

 that's the quickest way I can think of right now without any custom actions.

bye,

 Jean