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 / This may be biting of more than I can chew....

Author
Message
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 7th Oct 2008 06:46
Is there something that allows me to use the mouse to rotate the screen around based on the point that the mouse is at?

Like rotate around the position of the mouse, so I'm always looking at the mouse/center.

Basically, it would make the mouse the center of my screen.

If anyone has ever played an RTS you would understand this.
kBessa
18
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 7th Oct 2008 07:31
Can you explain it better?

I understand to things from you question:

1-Rotate from mouse position
2-Rotate from center of the screen (like in RTS).

When you say Basically, it would make the mouse the center of my screen I really don't get which of the two you want.

[center][center]
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 7th Oct 2008 08:00 Edited at: 7th Oct 2008 08:07
This should do the trick (*this is psuedocode, so don't copy and paste - obviously won't compile* ):

ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 7th Oct 2008 08:44
Quote: "Can you explain it better?

I understand to things from you question:

1-Rotate from mouse position
2-Rotate from center of the screen (like in RTS).

When you say Basically, it would make the mouse the center of my screen I really don't get which of the two you want."


It will rotate the screen as if the mouse was the center.



Quote: "This should do the trick (*this is psuedocode, so don't copy and paste - obviously won't compile* ):

+ Code Snippet"


A little more explanation would be nice
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 7th Oct 2008 10:34
Rei - What Willie came up with is just perfect. You just need to translate it.












If you have a problem and want to make a task, then write down with your own words what you want. Try to split it up in parts as much as possible still not using any command but just your own words.

When you have the description then you can start to code the parts in it. You can't just sit and write on your keyboard and then suddenly have a game. I have been there and now Im using weeks for making description for just small programs just to be sure that I have everything

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
Willie Mundermuffin
18
Years of Service
User Offline
Joined: 5th Jan 2006
Location:
Posted: 7th Oct 2008 13:57
To be honest, if you aren't able to handle a simple task like camera rotation, I'm not quite sure you're ready to write a game, especially in C++. If the game is at all complex, you'll be needing to write MUCH more complex algorithms than this in the future. A good idea would be to write a bunch of small apps, each tackeling a particular task you want to learn, and once you have a good base knowledge, begin on the design/tech docs for a game. A word of advice (for anyone): don't even open the IDE until you've got a solid design/tech doc ready. Believe me, it'll make coding MUCH MUCH faster, you'll stay more focused on the task at hand, you'll discover issues that need to be resolved beforehand, and most importantly, the project will feel like a single unit as opposed to a bunch of small "chunks" forced together, which is what most end up being. Another piece of advice, don't hard code values. Figure out (beforehand) a system in which to assign the values, whether it be through #define macros (not best solution), files, whatever. This allows your app to be flexible and easier to debug/test. Remember: the more flexible your app is, the less likely it is to break in different situations. Plus, this makes overcoming limitations/breaks a lot easier later on. The moral of the story: "Plan for the future!" and "An ounce of prevention is worth a pound (more like a ton) of cure."
SushiBox
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Ohio
Posted: 7th Oct 2008 15:43
This is confusing, I see your other source code an some of it is pretty nice. Other than your invalid address problem with your arrays.

I think the problem is, you are not "reading" the actual help docs or attempting to learn what each of the parameters mean and what they are required for.

I think you should be more worried about doing small individual projects rather than coding a full game atm.

You are progressing fairly well, dont get me wrong. Just some CC.

www.Helios-Online.net
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 7th Oct 2008 23:00
-_- I'm not coding a game pples. I'm making a rough one level demo that can get me an A in my Game and Simulation Programming Class.

Honestly, I'm not a game maker, I'm a simulation programmer.

I just wanna get the project done in time for my class.

Once this class is over, I'll actually have time to sit down and play around with things.
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 7th Oct 2008 23:00
-_- I'm not coding a game pples. I'm making a rough one level demo that can get me an A in my Game and Simulation Programming Class.

Honestly, I'm not a game maker, I'm a simulation programmer.

I just wanna get the project done in time for my class.

Once this class is over, I'll actually have time to sit down and play around with things.

Quote: "Just some CC."

CC?
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 7th Oct 2008 23:02
BTW You guys have the wrong idea to what I want...

I want the camera to turn in the direction that the mouse is moving, when the mouse button is pressed.
SushiBox
16
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Ohio
Posted: 7th Oct 2008 23:46
...Triple post?

I am very confused, at first you asked for this:
Quote: "Like rotate around the position of the mouse, so I'm always looking at the mouse/center."


Then when we answer, you say thats wrong and you want this:
Quote: "I want the camera to turn in the direction that the mouse is moving, when the mouse button is pressed."


The second one is on the forum already a few times at that. Check out the search function, its leet.

www.Helios-Online.net
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 8th Oct 2008 21:26
so you want:

wrote that from my head without trying, may have got some of the functions wrong
ReiKumar
16
Years of Service
User Offline
Joined: 23rd Sep 2008
Location:
Posted: 9th Oct 2008 04:19
Quote: "so you want:
+ Code Snippet

if(dbMouseClick(1)){
dbPitchCameraUp(dbMouseMoveY());
dbTurnCameraRight(dbMouseMoveX());
}


wrote that from my head without trying, may have got some of the functions wrong "


I think that is what I want.

Login to post a reply

Server time is: 2024-11-25 03:39:50
Your offset time is: 2024-11-25 03:39:50