Move a camera without c_move

Posted By: er_willy

Move a camera without c_move - 02/06/09 21:27

hello

I want to move the camera on x and y using the mouse:

Code:
		//Move
		if  (mouse_left == 1)	
		{		


			vec_for_angle(tempo,camera.pan);
			
			//movimientos laterales	
			camera.x += (mouse_force.x * time_step) * tempo.y;	//movimientos laterales			
			camera.y -= (mouse_force.x * time_step) * tempo.x; //* tempo.x;	//movimientos laterales	
		
		}

tempo is a 3d vector

But my vectors and matematicals skills are too low and only get the lateral move.

someone can helpme smile thanks.

Posted By: er_willy

Re: Move a camera without c_move - 02/07/09 10:28

ok I put the code finish and working if any need

Code:
			vec_for_angle(tempo,camera.pan);
			
		//movimientos laterales	
		//	camera.x += (mouse_force.x * time_step) * tempo.tilt;	//movimientos laterales			
		//	camera.y -= (mouse_force.x * time_step) * tempo.pan; //* tempo.x;	//movimientos laterales	

			camera.x += mouse_force.y * 10* time_step* tempo.x; 		
			camera.y += mouse_force.y * 10* time_step* tempo.y;				
			camera.z += 0;//mickey.z * tempo.roll;

© 2024 lite-C Forums