Fly through Tuto 10
I want to fly not walk through tuto 10. But I´m too silly for this. It didn´t work(by me of course!) Can anybody help me??
The movementfunktions are my problem I want to go to that direction that I chose. Fly to the floorand so. That ´s it!
PLEASE!!
Thx!
You''re going to first have to create two other key input commands... Let''s say ''S'' and ''W'' just because... Then you''ll need to use those to increment the xRot variable that you''re going to use that''s similar to the yRot variable you''ve already got... You may have to find out the new vector that the view area''s x-axis lies on depending on where the translations are applied... Then, after you''re rotating and able to look up and down, you will need to account for that direction when moving... So, you''ll need a line like
if (keys[VK_UP])
{
yada yada...
ypos -= (float)cos(xrot*piover180) * 0.05f;
}
same for VK_DOWN except plus-equals instead of minus-equals... or something of the sort...
S.
if (keys[VK_UP])
{
yada yada...
ypos -= (float)cos(xrot*piover180) * 0.05f;
}
same for VK_DOWN except plus-equals instead of minus-equals... or something of the sort...
S.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement