Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - electrux

Pages: [1]
1
Graphics / Re: Angle between 2 points
« on: August 22, 2014, 07:40:53 am »
nevermind... got it working by multiplying by float thanks :D and again, SFML FTW!!!!

2
Graphics / Re: Angle between 2 points
« on: August 22, 2014, 07:21:55 am »
ok sorry but how did u define deltaTime? i tried Vector2f but it give me error that no function matches the operand *

3
Graphics / Re: Angle between 2 points
« on: August 21, 2014, 06:39:09 pm »
huh?! it was that easy?! lol and i was even bothering my math teacher for a way >_<.. anyways thanks very much :D SFML rocks!!!! best library i seen to start with game programming (btw m new to game programming so sorry i dont know almost everything...) thanks again :D

4
Graphics / Re: Angle between 2 points
« on: August 21, 2014, 05:52:32 pm »
ah this degree thing dont work for me... ima see degrees later but atm,
can i create an equation of straight line and use it to move my projectile along the vector? using 2 point formula and then entering a varying (i++ or something) in x coordinate to get y?
will it work?

5
Graphics / Re: Angle between 2 points
« on: August 21, 2014, 02:20:50 pm »
ok apparantly my angle never changes... i cout'ed the sin(angle) and its always -0.8... now lemme see where i did the mistake that the angle isnt calculated properly :/

6
Graphics / Re: Angle between 2 points
« on: August 21, 2014, 02:11:36 pm »
ok ok sorry guys i will refer the api... tyvm btw :) lemme try it :D

7
Graphics / Re: Angle between 2 points
« on: August 21, 2014, 01:43:55 pm »
Error: class sf::RenderWindow has no member pixelToCoords :/

8
SFML projects / Re: Dwell - A Retro Sandbox Survival MMO
« on: August 21, 2014, 11:11:04 am »
i really need to learn wat and how data will flow on network... tried making an mmo like game but gave up coz i dont have enough knowledge on network atm... so... ima try making single player first :P anyways nice job :D

9
SFML projects / Re: F.I.R.E.D. v0.99.pre-alpha
« on: August 21, 2014, 11:04:23 am »
its awesome man!!! so beautiful :D

10
Graphics / Re: Angle between 2 points
« on: August 21, 2014, 10:53:33 am »
i used windows calculator for value of pi (ripped off some values after point(.) and i used this for mouse:
sf::Vector2i mousepos = sf::mouse::getPosition(window);

11
Graphics / Angle between 2 points
« on: August 21, 2014, 08:08:32 am »
Hello everyone,
i am trying to get the angle between 2 points (1 of player and other of mouse).
i use this:

float getangle(float _x1,float _y1, float _x2, float _y2) // x1 and y1 are pos of mouse and x2 and y2 are pos of player
{
   float _ang, _pi = 3.1428;
   _ang = atan2(_y2 - _y1,_x2 - _x1) * (180/_pi);
   return _ang;
}

but it only gives me 4rth quadrant angle about 45 degree.
i saw another topic about it but was unable to understand... please help  :(

Pages: [1]
anything