3rd Person Camera
ok this werks kewl however when i add the stencil shadows i notice i hover off the floor..I put the faerie in there and it did not hover..so i'm assuming i need to send some kinda ofset to my bounding box (for collision) because it would apear that that is what determins your Z..(in relation to the floor) Am i headed down the right road?
Today I've tried to get this 3rd person camera to work again, but I had no luck. I always get these linker errors powerpop mentioned, even with boogles sample file. Maybe this has to do with the VC-project file I've created for the sample. Can someone please explain me the important project-settings, because I'm a C++-newbie and don't know what directly causes this error? Many thanks in advance
Edit: OK, it works now. I've just changed "_WinMain(...)" to "main()"
Edit: OK, it works now. I've just changed "_WinMain(...)" to "main()"
-
- Posts: 5
- Joined: Sat Apr 24, 2004 3:23 pm
- Location: Texas
Ive tried to compile the source code to the camera, but i get these compile errors in DevCpp:
In file included from CSceneNodeAnimator3PPlayer.h:4,
from 3rdPersonCamera.cpp:10:
CSceneNodeAnimator3PCamera.h:9: redefinition of `class
CSceneNodeAnimator3PCamera'
CSceneNodeAnimator3PCamera.h:9: previous definition of `class
CSceneNodeAnimator3PCamera'
CSceneNodeAnimator3PCamera.h:9: confused by earlier errors, bailing out
make.exe: *** [3rdPersonCamera.o] Error 1
any ideas what
In file included from CSceneNodeAnimator3PPlayer.h:4,
from 3rdPersonCamera.cpp:10:
CSceneNodeAnimator3PCamera.h:9: redefinition of `class
CSceneNodeAnimator3PCamera'
CSceneNodeAnimator3PCamera.h:9: previous definition of `class
CSceneNodeAnimator3PCamera'
CSceneNodeAnimator3PCamera.h:9: confused by earlier errors, bailing out
make.exe: *** [3rdPersonCamera.o] Error 1
any ideas what
Nevermind. I just tried creating a new win32 console app, adding in ALL the .cpp and .h files in the directory, and replaced the convoluted main with a simple "int main()" and now it works wonderfully.
I found this, by the way, while trying to get my controls to work better; I think I like the 3p camera I made better (although it's not a pretty scene node animator), and once I fix the controls and a few other things I'll post it.
I found this, by the way, while trying to get my controls to work better; I think I like the 3p camera I made better (although it's not a pretty scene node animator), and once I fix the controls and a few other things I'll post it.
My take on the 3rd person camera
Here's my attempt at a 3rd Person following camera a'la Wind Waker, Jak II, etc. As usual, you'll need to copy Sydney and the map into the same directory.
http://www.unm.edu/~luvcraft/main.cpp
Move the player with arrow keys, rotate camera with A and S.
I wanted to make the player move more like Wind Waker or Jak II (i.e. like Boogle's demo, but with the character rotating to the right direction first, then moving), and I thought I could just base it off the rotation of the camera, except that setTarget() doesn't actually change the camera's rotation at all! Argh! So, what would be the easiest way to get a Y-axis rotation value based on the camera's target?
---Added 4/26
Alrighty, I've implemented some semi-Wind-Waker-like controls. I'm not really happy with them, but I'm done for tonight. Hopefully someone can give my some input on them to make them less absolutely horrible. Same URL as the previous post.
If you want to try out the old controls, which were less freaky but also less like what I'm aiming for, just change the resolve_controls_WW() to resolve_controls_RE() and recompile.
Woohoo! Fourth post in a row by me! I just love talkin' to myself... yay...
Also, is it just me, or are Y and Z swapped in getRotationDegrees() ?
http://www.unm.edu/~luvcraft/main.cpp
Move the player with arrow keys, rotate camera with A and S.
I wanted to make the player move more like Wind Waker or Jak II (i.e. like Boogle's demo, but with the character rotating to the right direction first, then moving), and I thought I could just base it off the rotation of the camera, except that setTarget() doesn't actually change the camera's rotation at all! Argh! So, what would be the easiest way to get a Y-axis rotation value based on the camera's target?
---Added 4/26
Alrighty, I've implemented some semi-Wind-Waker-like controls. I'm not really happy with them, but I'm done for tonight. Hopefully someone can give my some input on them to make them less absolutely horrible. Same URL as the previous post.
If you want to try out the old controls, which were less freaky but also less like what I'm aiming for, just change the resolve_controls_WW() to resolve_controls_RE() and recompile.
Woohoo! Fourth post in a row by me! I just love talkin' to myself... yay...
Also, is it just me, or are Y and Z swapped in getRotationDegrees() ?
-
- Posts: 5
- Joined: Sat Apr 24, 2004 3:23 pm
- Location: Texas
well, luvcraft, thought i'll download your code to see if it works and it seemed to start to compile right, but then i get a error:
main.o(.text+0x89a):main.cpp: undefined reference to `_imp___ZN3irr12createDeviceENS_5video11EDriverTypeERKNS_4core11dimension2dIiEEjbbPNS_14IEventReceiverEPKw'
any ideas?
main.o(.text+0x89a):main.cpp: undefined reference to `_imp___ZN3irr12createDeviceENS_5video11EDriverTypeERKNS_4core11dimension2dIiEEjbbPNS_14IEventReceiverEPKw'
any ideas?
What compiler are you using? Do the irrlicht examples compile OK?Hjortur239 wrote:well, luvcraft, thought i'll download your code to see if it works and it seemed to start to compile right, but then i get a error:
main.o(.text+0x89a):main.cpp: undefined reference to `_imp___ZN3irr12createDeviceENS_5video11EDriverTypeERKNS_4core11dimension2dIiEEjbbPNS_14IEventReceiverEPKw'
any ideas?
-
- Posts: 5
- Joined: Sat Apr 24, 2004 3:23 pm
- Location: Texas
-
- Posts: 158
- Joined: Wed Apr 28, 2004 11:03 am
- Location: Hungary
- Contact:
On a sidenote, I broke the camera into camera.cpp, main.cpp and main.h files so it's relatively easy to put it into other stuffs if someone needs it - camera is now being handled by two functions, depending what you want.
The two are
void FixedCameraUpdate(p1_movedir, p1, camera, moving, cam_rotate);
void RubberCameraUpdate(p1_movedir, p1, camera, moving, cam_rotate);
The fixed camera stays behind the viewed node from a fixed angle and distance (if anybody played Drakan- Order of the Flame knows what this is like for sure) and shows the front of the node being viewed if cam_rotate has a value. RubberCameraUpdate is your function, actually. I found this way it nice, coz you can define more camera styles, and change the object being followed simply by changing a variable.
Just wondered if you could get Newton working with this camera code. I keep getting crashes and tons of errorrs with newton being implemented - starts to annoy me... lol
The two are
void FixedCameraUpdate(p1_movedir, p1, camera, moving, cam_rotate);
void RubberCameraUpdate(p1_movedir, p1, camera, moving, cam_rotate);
The fixed camera stays behind the viewed node from a fixed angle and distance (if anybody played Drakan- Order of the Flame knows what this is like for sure) and shows the front of the node being viewed if cam_rotate has a value. RubberCameraUpdate is your function, actually. I found this way it nice, coz you can define more camera styles, and change the object being followed simply by changing a variable.
Just wondered if you could get Newton working with this camera code. I keep getting crashes and tons of errorrs with newton being implemented - starts to annoy me... lol
Staring through eyes of hate we kill
Are we controlled, or is our own will...?
(Edguy)
Are we controlled, or is our own will...?
(Edguy)
Great! Can you please upload these files? I have some problems with my 3rd person camera, so I would be very happy if I could try your code.AssiDragon wrote:On a sidenote, I broke the camera into camera.cpp, main.cpp and main.h files so it's relatively easy to put it into other stuffs if someone needs it - camera is now being handled by two functions, depending what you want.