Cross product help

I’ve been trying to get cross product working for an assessment.

What I’m using it for:

  • Trying to work out if player is left or right of the way the swivel is currently facing so that when I rotate the swivel to face player I can make it smootly rotate the right way around (currently it just snaps to the player, and my teacher suggested I could try using cross product to work out what side the player is on)

How I’ve done it:

How it appears:

*Note: rotating the turret was just so I could see the outcome of the cross product.

  1. Is this a good use of cross product, and if not what else could I use it for within the game? I need it as a requirement for a good grade since you need to use all the technical functions for an A+, and this is the last one I have left.
  2. If it is the right use, how do I proceed from here? Got a little stuck.

I don’t think cross product is what you should use here, there is another vector operation that is used to determine whether a vector is aligned with another vector, which I won’t mention since it’s for homework

But a quick google search can shed some light on how to find if an actor is left or right of another actor :eyes:

So what would I use cross product for then? I’ve been stuck on this for days and no classmates are responding (or even have an idea of it)

And the suggestion on the left/right thing is appreciated, I’ll take that into consideration.

I don’t think cross product is useful here really

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.