Smooth mixed 1st + 3rd Person Camera Scene Node (for RPG)

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
ssexton
Posts: 54
Joined: Wed Oct 25, 2006 7:46 am
Location: South Florida
Contact:

Post by ssexton »

Camera does seem to work with 1.3, with just renaming that method.
abraham
Posts: 30
Joined: Wed Jul 19, 2006 8:56 am

Post by abraham »

cool thanks:) i try this once irrwizzard is on 1.3:)
n7600gt 256mb ram 128bit
AMD 3200+
GA-K8NF-9 gigabyte
bcronje
Posts: 10
Joined: Thu Mar 29, 2007 9:10 pm

Post by bcronje »

abraham wrote:cool thanks:) i try this once irrwizzard is on 1.3:)
Abraham, look at my post on http://irrlicht.sourceforge.net/phpBB2/ ... &start=240 to compile irrwizard with 1.3, should take you 30secs to sort out.

Beyers
death_au
Posts: 38
Joined: Tue Apr 17, 2007 9:48 am
Location: Australia

Post by death_au »

I seem to be getting quite a few problems trying to compile this in 1.3...
changes.txt wrote:- The methods OnPreRender and OnPostRender of ISceneNode have been changed to OnAnimate and OnRegisterSceneNode(). Also, they are now called at different times: OnAnimate is called every frame before anything else, removing the one-frame-lag Irrlicht suffered until now. To make most of your own scene nodes work again, it should be enough to rename OnPreRender() to OnAnimate() and OnPostRender() to OnRegisterSceneNode() in most cases.
I tried renaming those methods, but OnRegisterSceneNode() no longer takes in a time like OnPreRender() did, whereas OnAnimate() does unlike OnPostRender(). Being a complete noob at this, I don't know what does which and if the order should just be reversed or something simple like that...
also...
Changes.txt wrote:- changed spelling "frustrum" to "frustum"
-> changed also SViewFrustrum.h to SViewFrustum.h
That's an easy one to fix.... But now the compiler's telling me that CCameraRPGSceneNode is abstract because it doesn't implement the getViewFrustum() abstract method. What has to be done in this method? Just return a reference to the ViewArea?

It would be really helpful to get this camera working on 1.3...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The description was reverted (or not as exact as one might want it) so just use the methods with the same signature.
The getViewFrustum has to use a const somewhere to match the signature of the interface method.
bcronje
Posts: 10
Joined: Thu Mar 29, 2007 9:10 pm

Post by bcronje »

@death_au

I compiled this last night with 1.3 making the following changes:

I use the irrLicht 1.3 CCameraSceneNode.h and CCameraSceneNode.cpp, so include them in your project and not the camera supplied ones. Not sure if the original developer of this cam made any changes to it's CCameraSceneNode (which would be silly if he did), but it seems to work fine with irrLicht's.

In CCameraRPGSceneNode.hpp and CCameraRPGSceneNode.cpp

Change

Code: Select all

virtual void OnPostRender( u32 timeMs );

To

Code: Select all

virtual void OnAnimate( u32 timeMs );
That did it for me.

Beyers
death_au
Posts: 38
Joined: Tue Apr 17, 2007 9:48 am
Location: Australia

Post by death_au »

bcronje wrote:@death_au

I compiled this last night with 1.3 making the following changes:
<snip>
That did it for me.

Beyers
Worked for me too. Thanks a lot. I really appreciate it.

Edit - Actually..... Now the fairy in the example app isn't skinned. Hmmm... I'll look into it a bit more....
death_au
Posts: 38
Joined: Tue Apr 17, 2007 9:48 am
Location: Australia

Post by death_au »

Sorry for the double post, but I can't figure this out... Textures appear to be loading properly, but they're not being displayed. They display correctly in the irrlicht 1.1 version, but in the modified 1.3 version I just get a black fairy in the example. I can't really see why. The console says it's loading the textures correctly, and in the irrlicht tutorials textures display correcty.

Odd... The textures display correctly if I use the software renderer, but not with DirectX or OpenGL...
Frodenius
Posts: 64
Joined: Sun Aug 29, 2004 11:24 am
Location: Germany/Frankfurt
Contact:

Post by Frodenius »

i have the same problem but thats probably the bad graphic hardware..
worst programming style ever seen...
bcronje
Posts: 10
Joined: Thu Mar 29, 2007 9:10 pm

Post by bcronje »

death_au wrote:Sorry for the double post, but I can't figure this out... Textures appear to be loading properly, but they're not being displayed. They display correctly in the irrlicht 1.1 version, but in the modified 1.3 version I just get a black fairy in the example. I can't really see why. The console says it's loading the textures correctly, and in the irrlicht tutorials textures display correcty.

Odd... The textures display correctly if I use the software renderer, but not with DirectX or OpenGL...
Use

Code: Select all

fairy->setMaterialFlag(E_MATERIAL_FLAG::EMF_LIGHTING, false);
Beyers
death_au
Posts: 38
Joined: Tue Apr 17, 2007 9:48 am
Location: Australia

Post by death_au »

Ah! Right! My map I'm loading has no lights (at least, there's no dynamic lights, anyway....) So why isn't ambient light lighting my model in that case? Anyway, just putting a few lights around will also do the trick I reckon.
Darress
Posts: 1
Joined: Fri May 25, 2007 9:52 am

Post by Darress »

Pls somebody send me a workable version in 1.3 of this camera! I couldn't get it work. (darress@gmail.com). Thx!
lehanpham
Posts: 1
Joined: Tue Jun 12, 2007 7:13 pm

Post by lehanpham »

Can anybody please send me(lehanpham@gmail.com) or update the link of this workable version of this camera and the cam.xml file?

Thanks
Nebu
Posts: 1
Joined: Wed Jun 27, 2007 10:47 am

Post by Nebu »

bcronje wrote:@death_au

I compiled this last night with 1.3 making the following changes:

I use the irrLicht 1.3 CCameraSceneNode.h and CCameraSceneNode.cpp, so include them in your project and not the camera supplied ones. Not sure if the original developer of this cam made any changes to it's CCameraSceneNode (which would be silly if he did), but it seems to work fine with irrLicht's.

In CCameraRPGSceneNode.hpp and CCameraRPGSceneNode.cpp

Change

Code: Select all

virtual void OnPostRender( u32 timeMs );

To

Code: Select all

virtual void OnAnimate( u32 timeMs );
That did it for me.

Beyers
I made the same changes, the compilation is ok, but when i start my test, none of the keys works, the cam won't move.
Anyone tried the cam with irrlicht 1.3.1?
(i don't have any cam.xml because i wasn't in the archive i've downloaded)

Edit: Ok i found the solution, it was the speeds configuration which were too slow :)
~ Dream
Posts: 12
Joined: Fri Jun 29, 2007 11:28 am
Location: The Dream World

Post by ~ Dream »

hi people. After reading the replies, this camera seems to be great. If anyone has successfully edited the codes to suit 1.3.1, please share it with us, cheers!
~ Dream
Post Reply