Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Mouse control camera

Author
Message
paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 1st Mar 2009 05:22 Edited at: 1st Mar 2009 05:28
Im trying to get the mouse to control the camera and rotate object1 ,could someone show me please.

paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 1st Mar 2009 17:39
Im still looking for the answer also could limb 32 mesh 1,be rotated with the mouse and camera instead of object 1?
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 1st Mar 2009 19:13
Your code isn`t suitable to compile and you haven`t made it clear what you expect to see. Do you wish to rotate the object first and then position the camera at a set distance away using the objects rotation to determine the position of the camera like in 3rd person? If so will you be using terrain or is it free flight your after? Or are you asking how to match the objects angle with the camera at the same location like in 1st person?

Your second post doesn`t make sense - you can only have 1 mesh per limb...
If your still looking for an answer to another thread you should either
1)post on the other thread
2)if the subjects are directly related, then choose one thread and ask your question(s) again with as much detail as you can; overall what it is your trying to achieve. People will then be able to break down to you how to go about it. I`m just guessing here that a few of your recentish posts are related to one another? If you are finding that your explanations of what your trying to achieve are not getting across to people, then perhaps you should use references and diagrams of where you have seen what your trying to achieve.
paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 1st Mar 2009 19:36
this code works smoothly along y axis(the mouse controls the camera),x axis flickers:


James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 1st Mar 2009 20:27
Nothing appears to flicker for me - if you mean jerky ie you want smoother movement, then just replace the second to last line with
"rotate camera camera angle x()+(mousemovey()/4.0),camera angle y()+(mousemovex()/4.0),0", is that what you mean?
paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 2nd Mar 2009 04:13
Im almost there with my aiming I just need to know how to attatch the limb to the mouse as well as the camera which is already attatched,or alternatively attatch object 1 to the mouse as well as the camera,almost done.

James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 2nd Mar 2009 23:16
Limb 1 is a gun - part of object 1? Or if its a gun, is the gun a seperate object glued to a limb of object 1, with a limb of its own for the sights? Is this 1st or 3rd person?
If your limb, whatever it is, if its position and rotation is dependent on the animation then you need to position the camera at the limbs position, not position the limb to the camera, unless the animated limb is a seperate model of arms and weapon. Really need to know more on what you have overall and what your goal is overall.
paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 3rd Mar 2009 19:12
Player 1 is object 1 with 31 limbs,ive added a limb,32,made a mesh from it and offset it 500 units in front of player 1,I have a cross-hair attatched to the mouse and so is the camera when the spacekey is pressed,alls Im stuck with is how to xand y rotate limb 32 when the mouse is moved please and I should have a aiming and firing mechanism.


James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 3rd Mar 2009 20:11
I still need to know what the limb is/what its purpose here is, is it the gun, a dummy limb for a gun position, something to point the camera at? Where is your camera situated? How does it get moved? Does the limb have its own axis or does it share the objects root axis or perhaps its linked to limb 31?
You need to give a FULL explanation of what is in your scene and what is going on/intended to go on. It looks as though your trying to do either a first person view or 3rd person view or even a combo of both along with sights/zooming? The point is until you provide all the code you have so far and a complete description of your goal I don`t think I can help you...I have asked several times now, this will be the last.
paulhenry
16
Years of Service
User Offline
Joined: 20th Jun 2008
Location:
Posted: 3rd Mar 2009 22:21 Edited at: 3rd Mar 2009 22:31
The limb is for aiming from object 1(which is player 1,who has the rifle) to limb 32,offset 1000 units away,which when object 1 rotates it rotates with it,any enemy in between using the intersect object command gets health dec,when the spacekey is pressed and mouse click,also the camera changes to 1st person view,when the spacekey isnt pressed it follows in 3rd person view,everything runs well with this code,I just need a little help rotating the offset limb when the spacekey is pressed with the mouse.


James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 4th Mar 2009 02:21
The following may appear harsh(depends on how you read it), but it is not intended to.
The way you have gone about this is all wrong imo. You need to learn more about each command and how they work on there own. There is no indentation in your code, you need not post remmed out code it just makes it look bad and unclear. There is a mix of the use of upper and lower case text coupled with a change in the use of spacings between operands and between parameter seperaters like "(" and ","
All of this suggests a lot of cut copy and pasting then editing and lack of understanding of what each seperate part does.
I have just spent half an hour removing lines, indenting your code and then altering it. Couldn`t think of a way of matching the limbs position properly with the camera but this is what I got so far. Anything marked *** has been added or changed



I tried to continue the process for the x axis value of object 1 and then put it back for the other view, but couldn`t return it back to its original xrotation. Right now I`m going to sleep and will be busy the next few days/weeks.
It probably can be done but with a lot more time and effort than I`m willing to spend on it. Sorry

Login to post a reply

Server time is: 2024-09-28 02:29:53
Your offset time is: 2024-09-28 02:29:53