Advertisement

camera problem

Started by August 23, 2003 08:15 PM
3 comments, last by TonyFish 21 years, 6 months ago
Hi Help! Ok so what I''m trying to achieve is a lookat system like homeworld. I want to rotate horizontally around my cube by clicking the left mouse button and draging. My code should do it but when I drag the camera doesn''t budge. I think that the position where I click is the same as the position the code retrieves ie no movement but I can''t think of another way to achieve the effect. HELP! Code: (small) http://www.enisoc.com/~cpp/pastebin/?2402 <Fish>{
<Fish>{
(Haven't looked at your code yet) do you store the position of the mouse then its position in the previous frame?

Ok I looked at your code and uh that commented out line: myCamera.IncHRot((m_LastMousePos.x - s_MousePos.x)/100 * 10);
it would default to a movement of zero each time because of c++ rounding the number to 0.

[edited by - uber_n00b on August 24, 2003 10:19:47 AM]
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.
Advertisement
how do I get around that?
<Fish>{
typecasting..or change 100 to 100.0 and 10 to 10.0
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.
You should suffix your numbers with f - ie 100.0f - this designates a floating point number. If you omit the f suffix it will assume that the value is of type double.

This topic is closed to new replies.

Advertisement