Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / How to spin Camera around object

Author
Message
DrkTemplar
10
Years of Service
User Offline
Joined: 18th Aug 2011
Location:
Posted: 17th Aug 2012 02:55
I have an object at 0,0,0, and I'm using the below code to spin the camera around that object, but it moves way too fast. Too fast for me to even tell if its working correctly or not. Anyone know how to slow it down, or have a better method for controlling the camera in this fashion?



Thanks
APEXnow
Retired Moderator
19
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 5th Sep 2012 11:31
I think your problem is that you're using Cos and Sin which return angles in Radians. Converting the values to Degrees may help to resolve.

Converting Radians to Degrees is nornally done like

angleDeg = (RadAngle * 180) / PI (iirc)

Paul.

MrValentine
AGK Backer
11
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Sep 2012 14:36
Paul err APEXnow... are you the current GDK2 .NET developer?

I ask as I wish to enter into .NET development and would like to know where to look for it on here...

Thanks in advance

Quote: "angleDeg = (RadAngle * 180) / PI (iirc)"


No Wrapvalue? [or is that what the Pi is for?]

APEXnow
Retired Moderator
19
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 5th Sep 2012 20:30
MrValentine,

The Internet is generally the best place to search for detailed tutorials on .NET development, but the best way to learn, is to obtain a book on the subject. We do generally provide help on the games toolkits here, but to learn about .NET itself, will require some searching.

The formula is to convert the radians value from Cos and Sin, into degrees which is what will allow you to rotate smoothly. PI, is (Pi = 3.14159265)

Paul.

MrValentine
AGK Backer
11
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Sep 2012 22:26
Cheers APEXnow...

I suppose I will have to wait until I am ready and then buy a load of books again as I did for my current web studies

That is something I hope to remember to convert Radians to Degrees [Though I am still unfamiliar with Radians as a definition but surely enough I will pick it up ]



DrkTemplar
10
Years of Service
User Offline
Joined: 18th Aug 2011
Location:
Posted: 22nd Sep 2012 03:30 Edited at: 22nd Sep 2012 03:32
Quote: "angleDeg = (RadAngle * 180) / PI (iirc)"


I haven't had a chance to try this till now.

I did as you suggested but still needed to divide the distance moved by 50 just to slow it down. However, now I'm wondering how I can make the camera spin vertically around object, instead of just horizontally.

Thanks for you help!

Login to post a reply

Server time is: 2022-08-07 16:52:12
Your offset time is: 2022-08-07 16:52:12