camera_move problem?

Blitz3D Forums/Blitz3D Beginners Area/camera_move problem?

Guy Fawkes(Posted 2012) [#1]
Hi all, can someone please make it so that my camera code when resetting the mouse back to the middle of the screen, WONT affect my pitch/yaw rotation of my camera AT all? i figure if i keep resetting the mouse back to the middle WITH it doing this, that camera rotating will become EXTREMELY fast, and i dont have to keep dragging my mouse back to the middle of the screen everytime i wanna turn in a circle...


Here's the code:






Any help is GREATLY appreciated! :)



Thanks! :)

Last edited 2012


Ross C(Posted 2012) [#2]
What was wrong with the mouse code I had in the orginal editor I posted? My code the mouse never moved from the spot it was at when rotating the camera.


Guy Fawkes(Posted 2012) [#3]
Well. it was jittery. I need a solid cam that works WITHOUT selecting objects when holding down the left mouse button. where the mouse ALWAYS stays hidden, and in the middle.


Yasha(Posted 2012) [#4]
1) Use MouseSpeedX and MouseSpeedY rather than rewriting the same functionality yourself.

2) Take note that they mouse speed commands work with the mouse's movement since the last time they were called. Clever positioning of the commands (possibly in more than one place, hint) can therefore be used to remove unwanted effects from the reset command.


Guy Fawkes(Posted 2012) [#5]
it was WAY worse with it unfortunately :/

Last edited 2012


Ross C(Posted 2012) [#6]
My code was solid though. All it takes is a slight tweak to the selection code. I have included my mouse code, which gives you additional functionality such as:

Mouse just held
Mouse clicked
Mouse in
Mouse out
Mouse held



Why does the mouse need to stay in the middle? So, whenever the user moves the camera, the mouse jumps to the middle? That's odd. Anyway, I've made a very small tweak. And to hide the mouse use the hidepointer command, or if you have your own mouse, just don't draw it.

Last edited 2012


Guy Fawkes(Posted 2012) [#7]
Well, because I dont want to keep having to drag drag drag the mouse to be able to look around in a complete circle


Guy Fawkes(Posted 2012) [#8]
I just tested it, and it's MUCH better now! Thank you, Ross! :)


Btw, here's the PERFECTED version:






It STOPS it from jittering after the pitch# reaches 85.0 or -85.0.


It also adds a larger camera range, eliminating the nasty black area :)