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 / About Sparks Sliding Demo, I to change the direction of my repalced 3D object

Author
Message
yahya
16
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 23rd Jun 2009 13:54


When I replaced the sphere with the "Colonel-X.X", he keeps looking at the Camera.

I just want him to give his back to the Camera, so it would be like a normal FPS when I zoom to his head.
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 23rd Jun 2009 15:25
if you want the camera to keep looking at his back you will need to rotate that around him also

Come and have a look at my hobby site once your ready..
http://darkdstudio.webs.com/
Note: its still really bare..
yahya
16
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 23rd Jun 2009 15:33
I changed the Camera rotation:



The camera does move with the mouse, but each mouse postion changes the camera postion, ex: if I postion the mouse in x=300,y=300, the camers wouldbe upside down
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 23rd Jun 2009 16:10
You're going to have a few problems with that mouselook code:

1.) The mousemove commands have no spaces and no parameters - mousemovex(),mousemovey(),mousemovez()

2.) Z-rotating the camera will basically cause it to turn sideways - just x and y rotation should be enough.

3.) The mousemove commands return the distance in pixels the mouse has moved on the screen, as you probably know. However, this also means that if you just rotate the camera directly with those values, a little move is going to take it a long way. Try dividing them by 15 or so.

4.) Rotate Camera does not rotate a camera more along each axis - it sets the angle of the camera at each axis. Therefore, for this to work as you want, you need to add each value to the old camera angle. It's the same with Rotate Object and Rotate Sprite.

See if this code works for you:





Diggsey: I have a spine and memory, but one memorable guy says he hates me. What am I?
yahya
16
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 23rd Jun 2009 18:32
The Camera keeps looping around him like that :S
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 23rd Jun 2009 23:16
What do you mean by that? Could we see more of the code?



Diggsey: I have a spine and memory, but one memorable guy says he hates me. What am I?
yahya
16
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 24th Jun 2009 02:06
NVM mind, I found out I was rotating the 3D object i was using with :



on the same time I was :




after taking the 3D object rotation codes out, the Camera rotated with the nouse normally.

But now the 3D object doesn't move with the camera.
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 24th Jun 2009 03:18
i think i know what your trying to do..

Rotating your camera about its axis isnt what i think you are after, you will need to look into somesort of orbit code that moves with the mouse and will orbit around your character, then try adding in the character rotatin back in and try and get the orbit and rotations exactly right so that tha camera will follow him exactly..

unfortunately i havent done my homework on this and cant help you any further...

Come and have a look at my hobby site once your ready..
http://darkdstudio.webs.com/
Note: its still really bare..

Login to post a reply

Server time is: 2024-11-24 05:59:21
Your offset time is: 2024-11-24 05:59:21