What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Proper Entity Rotation

theonn

Member
Joined
Nov 3, 2014
Messages
80
Reaction score
6
Hello Fellow Devs / Out,

I have been working on a radar, however the rotation for entities is still kind of... crazy

the code im using:

PHP:
  double radians = memory.angle(player, x, y);
  radians = -(radians / 180.0 * Math.PI);


 public static ILocation2D RotateAroundOrigin2D(double x, double y, double radians)
        {
            double dx = x * (double)Math.Cos(radians) - y * (double)Math.Sin(radians);
            double dy = y * (double)Math.Cos(radians) + x * (double)Math.Sin(radians);

            return new Location(dx, dy, 0);
        }

any ideas?
 
Hello Fellow Devs / Out,

I have been working on a radar, however the rotation for entities is still kind of... crazy

the code im using:

PHP:
  double radians = memory.angle(player, x, y);
  radians = -(radians / 180.0 * Math.PI);


 public static ILocation2D RotateAroundOrigin2D(double x, double y, double radians)
        {
            double dx = x * (double)Math.Cos(radians) - y * (double)Math.Sin(radians);
            double dy = y * (double)Math.Cos(radians) + x * (double)Math.Sin(radians);

            return new Location(dx, dy, 0);
        }

any ideas?

some help out?
 
no is not, if you dont show the "bad" stuff. and besides im not talking about making a radar. i just want to know how to properly rotate. This can be used for pathing and etc.
 
dude, you are awsome! i love you i was missing the normalization you do
 
Back
Top