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.
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

lug wrote:xterminhate -- I hope you don't mind. I've updated your source files for your cam v8 to work with v1.2 of irrlicht.

Download:

http://www.megaupload.com/?d=09RQ53DM
Downloading now, if it works you're my hero. <3


UPDATE :
Yay it worked.
rs199483
Posts: 8
Joined: Thu Jan 04, 2007 9:11 pm

Post by rs199483 »

Hi, great camera work!! I am a complete noob at this so forgive me but how difficult would it be to add this type of functionality: Left click somewhere and have the camera automatically move to that spot, sort of like neverwinter nights or diablo type game? Thx
abraham
Posts: 30
Joined: Wed Jul 19, 2006 8:56 am

Post by abraham »

cool i got to work it to work aswell:) thanks sooooooo much!!!

but i get these warnings!
Image

what does no newline at the end mean?im running in safe mode becuase my pc wont acutally log into windows becuase it restarts,stupid viruses. so i cant run my projects:(

i dont konw if the warnings are causing my project to close down. But with my older projects i compiled do not work now:) so i think its just safemode,i hope the warnings arent stopping my project to work:(
n7600gt 256mb ram 128bit
AMD 3200+
GA-K8NF-9 gigabyte
xterminhate
Posts: 206
Joined: Thu Sep 01, 2005 9:26 pm
Location: France

Post by xterminhate »

lug wrote:xterminhate -- I hope you don't mind. I've updated your source files for your cam v8 to work with v1.2 of irrlicht.

Download:

http://www.megaupload.com/?d=09RQ53DM
I'm really busy and I did not take the time to update the cam. So thank you very much. Please, let me know the changes (or I will make a diff from previos).

Xter.
Return to Irrlicht after years... I'm lovin it.
It's hard to be a Man !
Si vis pacem para belum
xterminhate
Posts: 206
Joined: Thu Sep 01, 2005 9:26 pm
Location: France

Post by xterminhate »

rs199483 wrote:Hi, great camera work!! I am a complete noob at this so forgive me but how difficult would it be to add this type of functionality: Left click somewhere and have the camera automatically move to that spot, sort of like neverwinter nights or diablo type game? Thx
In fact, that doesn't really concern the camera itself.

I guess that you must retreive the XY screen coord of the cursor, then use the irr::scene::ISceneCollisionManager::getRayFromScreenCoordinates and irr::scene::ISceneCollisionManager::getCollisionPoint functions.

Probably one of the most interesting piece of 3D code - after camera - in a 3D RPG. Good luck :)

Xter.
Return to Irrlicht after years... I'm lovin it.
It's hard to be a Man !
Si vis pacem para belum
xterminhate
Posts: 206
Joined: Thu Sep 01, 2005 9:26 pm
Location: France

Post by xterminhate »

By the way, I thnik that WoW camera behavior is much more up to date that the one I sued for that camera. Maybe I will update that cam to provide a WoW style of camera.....
Return to Irrlicht after years... I'm lovin it.
It's hard to be a Man !
Si vis pacem para belum
lug
Posts: 79
Joined: Tue May 02, 2006 5:15 am
Contact:

Post by lug »

xterminhate wrote:
lug wrote:xterminhate -- I hope you don't mind. I've updated your source files for your cam v8 to work with v1.2 of irrlicht.

Download:

http://www.megaupload.com/?d=09RQ53DM
I'm really busy and I did not take the time to update the cam. So thank you very much. Please, let me know the changes (or I will make a diff from previos).

Xter.
Just diff it, xterminate. lug didn't do much to get it to work with v1.2 irrlicht. xterminate writes good code. :D lug not worthy! :(
MViolence
Posts: 1
Joined: Sun Jan 21, 2007 10:10 am

Post by MViolence »

Ciao,this camera is very good,but i have a problem with the characzer animation....
I create a class :

Code: Select all

Class EventReceiver : public IEventReceiver
{
  virtual bool OnEvent(SEvent Event)
if (event.EventType == irr::EET_KEY_INPUT_EVENT&&
			!event.KeyInput.PressedDown)
{
  switch(event.KeyInput.Key)
 {
   case KEY_KEY_W:
   {
     MyModell->SetFrameLoop(0,3000)
   }
     return true;
  }
}

 return false;
}
};
I run the prog.,and if i press the "W" button,the app is crashed,with acces violation fault...
You say "The CCameraRPGSceneNOde not handle the character animation,inherit a class from this CCameraRPGScneNode class",but How do i????

Pls Help me, :roll:
[/code]
xterminhate
Posts: 206
Joined: Thu Sep 01, 2005 9:26 pm
Location: France

Post by xterminhate »

You should modify the code of the camera to add support of animation. I still offer support for the camera (question about source?), but I have no longer time to help you in designing complex camera behavior based on this camera.

Xter.
Return to Irrlicht after years... I'm lovin it.
It's hard to be a Man !
Si vis pacem para belum
MKiG
Posts: 9
Joined: Sun Oct 29, 2006 3:55 pm

Post by MKiG »

I feel like a n00b here but i can get the camera to compile but as soon as it loads the XML file the program crashes. Looking in the irrlicht console, everything loads fine as all of the textures are there but unless i comment out:

smgr->setActiveCamera( cam );

it crashes no matter what i do. When this line is commented out though all I see is white with the odd flicker of black every now and then.
Image
pbot
Posts: 3
Joined: Tue Mar 20, 2007 12:01 am

compiling error

Post by pbot »

Error 1 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\irrlicht-1.3\examples\100. player camera rpg\irrcamerarpg\irrcamerarpg\ccamerascenenode.h 101
Error 2 error C2143: syntax error : missing ';' before '*' d:\irrlicht-1.3\examples\100. player camera rpg\irrcamerarpg\irrcamerarpg\ccamerascenenode.h 101
Error 3 error C2433: 'irr::scene::CCameraSceneNode::SViewFrustrum' : 'virtual' not permitted on data declarations d:\irrlicht-1.3\examples\100. player camera rpg\irrcamerarpg\irrcamerarpg\ccamerascenenode.h 101
Error 4 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int d:\irrlicht-1.3\examples\100. player camera rpg\irrcamerarpg\irrcamerarpg\ccamerascenenode.h 101

How to run this project??
pbot
Posts: 3
Joined: Tue Mar 20, 2007 12:01 am

Post by pbot »

I found out what was the problem. Incompatible version of Irrlicht. This code runs with Irrlicht 1.1 engine. Could author make the code compatible with Irrlicht 1.3 engine?? <sorry for my english>
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Move this to FAQ, sticky it, or just add the camera to irrlicht...
init512
Posts: 18
Joined: Mon Mar 26, 2007 6:08 pm
Contact:

Problems in 1.3

Post by init512 »

This problem *should* be easy to solve, but I have been working at it for two days without success. When I try to compile the RPG scene node with Irrlicht 1.3, CCameraRPGSceneNode.cpp compiles, but CCameraSceneNode.cpp will not compile with the Irrlicht SDK 1.3. I have tride replacing CCameraSceneNode.cpp and .h with the ones from Irrlicht 1.3, still with no success. The compiler (mingw32) reports errors in plane3d.h, part of Irrlicht. I have a feeling that I'm not including something into CCameraSceneNode.cpp, but any suggestions would be nice.

EDIT:
The problem I'm having is identical, exactly, to the one described here:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=19934
Including irrlicht.h into CCameraSceneNode.cpp or .h does not seem to work.

Thanks,
Marc
ssexton
Posts: 54
Joined: Wed Oct 25, 2006 7:46 am
Location: South Florida
Contact:

Post by ssexton »

For 1.3, you need to rename OnPostRender to OnAnimate, I think. This gets it to compile at least, and seems consistent with the built-in FPS camera. I'll try to post back later whether it works with 1.3 or not, once I get the rest of my code (not related to the camera) compiling with the 1.3 changes.
Post Reply