Gamestudio Links
Zorro Links
Newest Posts
Future of ZorroHFT
by TipmyPip. 11/16/25 13:52
COT Download with Quandl does not work
by Petra. 11/15/25 09:35
Training with the R bridge does not work
by Petra. 11/15/25 09:31
Zorro 2.70
by jcl. 11/15/25 08:43
Camera always moves upwards?
by NeoDumont. 11/14/25 16:32
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (TipmyPip, Grant, Ayumi, ozgur, Quad), 7,400 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
tritom, sheliepaley, Blueguy, blobplayintennis, someone2
19178 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: rotate player the shortest way [Re: Espér] #259072
04/03/09 17:53
04/03/09 17:53
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline

Serious User
VeT  Offline

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
its ont a vector, where to rotate, its the position, where to look

for example, BotTurnTo(my, player.x);


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: rotate player the shortest way [Re: VeT] #259082
04/03/09 18:28
04/03/09 18:28
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
ah.. yes.. i need the player to rotate into the direction i give him.. not to look at a model ^^


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: rotate player the shortest way [Re: Espér] #259103
04/03/09 21:41
04/03/09 21:41
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline
User
garv3  Offline
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
So that's really easy!

Code:
function turnPlayer(var angle, var turnspeed){
   if (player.pan%360 >= angle - 180 && player.pan%360 < angle){
      while(player.pan%360 < angle){
         player.pan += time_step * turnspeed;
      }
      player.pan = angle;
   }else{
      while(player.pan%360 > angle){
         player.pan -= time_step * turnspeed;
      }
      player.pan = angle;
   }
}


not tested!


GameStudio Version: A7 Pro v7.86
Re: rotate player the shortest way [Re: garv3] #259117
04/03/09 23:33
04/03/09 23:33
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
hmm.. it works a bit.. but now the rotation into the new direction is missing.. Doesn´t matter what turnspeed i add..


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1