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 / Camera Control with the Mouse problem

Author
Message
aerostudios
14
Years of Service
User Offline
Joined: 20th May 2009
Location: Oklahoma City OK (USA)
Posted: 21st Oct 2012 06:27 Edited at: 21st Oct 2012 06:30
Using the code from the GAME LEVEL example program for controlling the camera with the mouse, works fine in that example, using Visual Studio 2008/VB.NET. I added code to only manipulate the camera if you click the right mouse button in that example, and it works fine.

I took that same code and added it to my own program. But what happens is once I click the right mouse button, all the camera does is turn 180 degrees and stop.

Anyone know what could interfere with this piece of code?



I've had it inside the main game loop, and have created a PUBLIC SUB, all to no avail. It behaves the same way everytime.

This should continue to fire as long as you hold the RMB down. I've used it in my DBPro code and the Indigo IDE, I've just moved the code to Visual Studio 2008/VB.NET.
aerostudios
14
Years of Service
User Offline
Joined: 20th May 2009
Location: Oklahoma City OK (USA)
Posted: 23rd Oct 2012 23:40 Edited at: 23rd Oct 2012 23:42
Disregard my previous post. Here is the correct code. It appears "Mouse.MoveX" or "Mouse.MoveY" are not recognized, but "Mouse.MoveXAlternate" and "Mouse.MoveYAlternative" is.
Here is my method/routine(s) for controlling the camera with the mouse.

First, create a boolean variable at the module level;

Public rmb as boolean

Create additional global variables like I have:

Public Xcangle as single = 0.0f
Public Ycangle as single = 0.0f
Public xnewangle as single = 0.0f
Public MMY as single = 0.0f
Public MMX as single = 0.0f

Then, create this routine to be called anytime rmb is True.



rmb is set to true with the mouse down event attached to the CtlDarkGDKViewPort1 here when the right mouse button is pressed:



The mouse up event resets the rmb boolean back to false:



In the main game loop, call the routine anytime the rmb is true;



mmx and mmy are constantly updated to track where the mouse is before the call to PointCameraUsingMouse()

Login to post a reply

Server time is: 2024-03-28 11:24:27
Your offset time is: 2024-03-28 11:24:27