PDA

View Full Version : make the camera point at the mouse


axeraider131
02-04-2007, 05:51 PM
I am wondering if it is possible to make the camera follow the mouse without having to click. like in first person shooters. if anybody could tell me if this is possible or how to do it, any help would be greatly appreciated

-----------------------------------
Axeraider 131
<[}{]>
---------
+++++

DrJim
02-04-2007, 06:13 PM
See: http://www.alice.org/community/showthread.php?t=385&highlight=mouse

Maybe you can come up with something better. :)

(You could, of course, have the camera's point of view set to an invisible object that in turn follows the shooter instead of trying to follow the mouse.)

Shadow Sovereign
02-05-2007, 09:53 AM
There is an Example (assuming you installed alice with the CD) where a biplane flies thru several rings and wins a 6-pack of what seems to be Heineken's bastard cousin... I recall the camera steadily following the plane, so you may wish to look into that.

A link is below for those of you without CDs. ;)

PogoDaMonkey
02-05-2007, 12:42 PM
Er...Shadow...he means to have the mouse follow the camera, not an object. Like if the mouse moves left, the camera moves with it, left mouse button shoots, kind of like Doom or something, minus the keyboard. Havent figured out how to do this, and I don't think its possible in Alice 2.0, but if i figure something out, I'll tell you.

axeraider131
02-05-2007, 08:41 PM
yeah that is wat i meant. but thanks guys for trying to help. :D :D :D :D :) :) :)

DrJim
02-06-2007, 11:24 AM
What axeraider131 wants probably actually can be done - but I wonder if it's worth the effort. :confused:

Take a look at the attached. It's very similar to the program I did earlier but I've set the camera's vehicle and point of view to the sphere that the mouse is moving through the scene. I also very haphazardly put a little scenery in the world so you can see the mouse really is controling the camera's view without having to click a mouse button - so the button is free for "fire control". :)

The camera response is slow in this case, but that could easily be fixed by making the spere move faster. To make this useful for a game, however, one would have to figure out where to place the reference targets that the sphere moves towards and maybe even change to another target if the sphere had moved close to a specific target. This is where I stopped with the idea the first time I tried since I didn't have any specific goal in mind. :rolleyes:

The key point I want to make is that you can use the mouse position functions alone to control camera position. Can this be useful - ???

axeraider131
02-08-2007, 09:48 PM
what does this show? im kinda not understanding it. could you please explain it?
thank you in advance.

axeraider131

:D :D

DrJim
02-09-2007, 01:10 AM
It probably will help to take a look a the first thread if you haven't.

Basically the original question was what information can you get from the function that returns the mouse's position (answer - relative positions to the edge of the viewing window) and what can you do with this information (answer - move the red sphere around based on a couple of references, as in the first example world).

In this case, I also used the sphere to control camera viewpoint by moving the mouse and without clicking the mouse button - so that is available for some other function.

Unfortunately, it wasn't obvious the first time - and really isn't this time either - that what is demonstrated is actually useful. I just mentioned it because the option is there and someone else might see what I couldn't/can't - namely how to make this something useful.

Shadow Sovereign
02-09-2007, 07:46 AM
Er...Shadow...he means to have the mouse follow the camera, not an object. Like if the mouse moves left, the camera moves with it, left mouse button shoots, kind of like Doom or something, minus the keyboard. Havent figured out how to do this, and I don't think its possible in Alice 2.0, but if i figure something out, I'll tell you.

....whoops. I guess I didn't quite understand the question before.

Well, I do have another suggestion, but before I say it again, have you tried using the event handler in the top-right corner to use the mouse to control the camera?

tmorgan1689
02-09-2007, 02:01 PM
I think he wants it to automatically follow the camera, like if he moves the mouse to the left the camera goes to the left. Is there a way to do it with the position of the camera? I'm just throwing out some ideas because i've never tried it.

axeraider131
02-10-2007, 01:21 PM
errrr...What Sadow Soverign is showing makes you have to click and hold the mouse to change the view. i want to make something that doesnt require clicking. soooo. from what ive read, it really isnt possible in alice 2.0.

DrJim
02-11-2007, 06:37 PM
I really think it's theoretically "possible" - which is why I keep hoping somebody with more insight and/or ambition than I have will figure it out and post the answer. :o But it's sure easier to use the method Shadow Sovereign suggested and just "shoot" using the spacebar. :rolleyes: