Using Scroll Wheel

Problems building or running the engine, queries about how to use features etc.
The_Imp
Gnoblar
Posts: 3
Joined: Mon Jan 10, 2005 9:17 pm
Location: Sheffield, UK

Using Scroll Wheel

Post by The_Imp »

I'm trying to use the scroll wheel to zoom the camera in/out, and having searched on forums it appears I should be using the Z axis, but it doesn't seem to be working.

Here's the method that's causing me problems:

Code: Select all

void AvatarFrameListener::mouseDragged(MouseEvent *e) 
{
	if(pan) {
		Vector3 trv((e->getRelX() * 400.0), (e->getRelY() * 400.0), 0.0);
		mCamera->moveRelative(-trv);
	}
	
	Vector3 zv(0.0, 0.0, (e->getRelZ() * 400.0));
	mCamera->moveRelative(zv);	
	
	if(rotate) {
		mCamera->yaw(Degree(-e->getRelX()) * 200.0);
		mCamera->pitch(Degree(e->getRelY()) * 200.0);
	}
}
The pan and rotate works fine, but the zoom does nothing. Any suggestions as to why? Thanks.
The_Imp
Gnoblar
Posts: 3
Joined: Mon Jan 10, 2005 9:17 pm
Location: Sheffield, UK

Ye gods. Im stupid.

Post by The_Imp »

Just realised that scrolling the mouse wheel doesn't cause any form of dragging. Put it in mouseMoved and it works fine. D'oH!