Ferrettomato Posted July 28, 2015 Posted July 28, 2015 I'm trying (and failing) to get a Vec3 that's pointed towards an entity from another entity's perspective, without bringing its look vec in to consideration. This is probably really simple, but I can't figure it out. How? Quote
TheGreyGhost Posted July 28, 2015 Posted July 28, 2015 Hi For background info it might help to find an online introductory course into vector maths, just the simple stuff like adding & subtracting vectors, length, multiplying by a length, calculating angles between them, that sort of thing. A lot of minecraft stuff is based on vectors... The short answer is- deltaVector = targetPositionVector - originPositionVector targetVector is the entity being looked at. for example Entity1 = origin = located at [5, 4, 3] Entity2 = target (being looked at) = located at [10, 11, 1] the vector pointed from Entity1 toward Entity2 is [10-5, 11-4, 1-3] = [5, 7, -2] -TGG Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.