Hi,
didnt know where to put this. I wanted to know how the rotation_ in gWinZone.cpp is defined, because I need to substract the rotation factor from a sinus function to create some kind of standing sinus wave. It would be nice if someone can explain me how the rotation actually works or just tell me the factor in gZone::render() which rotates the zone each time.
It already works partially if I subtract the acos() of rotation_.x in the sinus function - first a standing wave is created - then probably after a half or a full rotation the wave is moving as long as it was standing first - it seems that this happens because of a prefix problem (first it substracts the (correct) rotation factor then it adds the factor whichs results in a change between standing and moving wave) - i also tried in several ways to get the absolute value with fabs() but it didnt changed anything.
(sorry for my bad english - i hope you could understand my problem)
best regards
name
rotation_ in gWinZone.cpp - standing sinus wave
it's this line in gZone::Timestep():
Your problems with acos would come from the fact that the cos function is not globally invertible and acos only is its inverse in a small area; it's what adds the perceived offset (really it's more of a reversal).
Code: Select all
rotation_ = rotation_.Turn( cos( angle ), sin( angle ) );
Ah, thanks - it seems to be solved.
Code: Select all
REAL angle = ( lastTime - createTime_ ) * speed;