mouse control screen?
Blitz3D Forums/Blitz3D Beginners Area/mouse control screen?
| ||
how do you make it so where the mouse goes, the camera turns that way? Could someone give code that would do that? thanks! |
| ||
Could you please use the forum search function and the Code Archives before you ask something? |
| ||
Also, check out the sample code that comes with B3D. The basic stuff is covered. |
| ||
ok, thanks |
| ||
http://blitzbasic.com/Community/posts.php?topic=80923 The last post here has a download that might help, though it's more for editing levels than looking around. But it is a mouse controlled camera. |
| ||
ok, I looked through the samples and I couldn't find the code... could anyone give me the code? |
| ||
The code archives are full of mouselook examples...you're just not looking hard enough. It seems to me from the amount of posts you have made and how you ask questions you are relying on others to supply you with code. Work harder Braden and it will pay off. |
| ||
ok |
| ||
Check the answer I posted in one of your other threads. It leads you to a good tutorial that should help with some of these basics. http://www.blitzbasic.com/Community/posts.php?topic=81576 |
| ||
thanks |
| ||
I checked out the tutorial and it worked, but, when I move the mouse, I can't figure out how to make it turn left and right, I was editing and testing the code to try and find an answer, but I couldn't figure it out... My question is, how do I make the mouse turn the screen left and right? here is the code I got from the tutorial... TurnEntity camsphere2, 0, -MouseXSpeed()/5.0, 0 ;rotate player Pivot according to mouse X movement TurnEntity camera2, MouseYSpeed()/5.0, 0, 0 ;rotate camera up/down according to mouse Y movement If EntityPitch(camera2) < -45 ;don't allow camera to look below -45 degrees RotateEntity camera2, -45, EntityYaw(camera2), EntityRoll(camera2) EndIf If EntityPitch(camera2) > 45 ;don't allow camera to look above 45 degrees RotateEntity camera2, 45, EntityYaw(camera2), EntityRoll(camera2) EndIf MoveMouse GraphicsWidth()/1.3, GraphicsHeight()/2.1 ;reset mouse position to middle of screen thanks |
| ||
Looking at the code you posted above, you are turning "camsphere2" on the first line of code, and "camera2" on all of the others. The actual code looks like it should work. |
| ||
I ahd to switch camsphere2 with camera 2, it worked! thanks! |