I've got this idea - which I'm sure wont work anyway, but here's the pitch.
I'm working on an ISO game, that doesnt have a fixed camera - instead you can zoom round and in & out. (bit like the insidey bits of commando 2)
Thats all sorted, but I want to control my main character by pointing the way with the mouse on screen.
I cant use some of these fancy 2d projection functions that already exist, cos the camera and axis wont be fixed.
My idea is to find the 2d coords of the object, compare them with the mouse coords. With that info, hopefully find the amount of rotation required around the Y axis of my character to point it in the right direction. Doesnt matter where the Z or X of entity are, just as long as I can rotate to the same direction as to where the mouse is pointing.
I've got the 2d coords of my entity, and the mouse coords. But I think I need some 'TRIG' to work out the angle of one to the other to give me a rotation value. (dont want to use pivots, rather keep it maths based as the camera moves about too much)
Any advice/help please Guys !
Thanks.
I'm working on an ISO game, that doesnt have a fixed camera - instead you can zoom round and in & out. (bit like the insidey bits of commando 2)
Thats all sorted, but I want to control my main character by pointing the way with the mouse on screen.
I cant use some of these fancy 2d projection functions that already exist, cos the camera and axis wont be fixed.
My idea is to find the 2d coords of the object, compare them with the mouse coords. With that info, hopefully find the amount of rotation required around the Y axis of my character to point it in the right direction. Doesnt matter where the Z or X of entity are, just as long as I can rotate to the same direction as to where the mouse is pointing.
I've got the 2d coords of my entity, and the mouse coords. But I think I need some 'TRIG' to work out the angle of one to the other to give me a rotation value. (dont want to use pivots, rather keep it maths based as the camera moves about too much)
Any advice/help please Guys !
Thanks.