creating CCal3dSceneNode

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

creating CCal3dSceneNode

Post by terrorchrist »

Hi guys!
As I am trying to use the CCal3dSceneNode from
http://thomas.webtracker.ch/jahia/Jahia/pid/672
I wondered how to load this SceneNode into the Scenemanager!
I mean calling sceneManager->addAnimatedMeshSceneNode(...) obviously would not work!

so I thought about creating an empty SceneNode with the manager and afterwards just instanciate the CCal3dSceneNode with

Code: Select all

ISceneNode * node = this->smgr->addEmptySceneNode();
CCal3DSceneNode *cal = new CCal3DSceneNode("../media/models/knight/cal3d.cfg", node, this->smgr);
but this seems to be not clean programming for me as I just want ONE scene node and not a parent->child relationship.
So can I also just load the cal3dscenenode into the scenemanager?
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

Use getRootSceneNode() instead of addEmptySceneNode().
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

Post by terrorchrist »

ok thanks
so it would be

Code: Select all

CCal3DSceneNode *cal = new CCal3DSceneNode("../media/models/knight/cal3d.cfg", 0, this->smgr);
this->smgr->getRootSceneNode()->addChild(node);


but my problem NOW is, that my program crashes as I instanciate my CalCoreModel

Code: Select all

m_pcalCoreModel = new CalCoreModel("lolly");
because of the std::bad_alloc exception....

did anyone of you ever have this prob?
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

Post by terrorchrist »

Hi!
I already solved creating the CalCoreModel without crashing by using the cal3d_d.dll instead of the cal3d.dll (the release version).

but now I encountered the problem, that the cal model is not rendered....

how can I achieve this?

I mean until now I've this code:

Code: Select all

ISceneNode *IrrlichtManager::LoadMesh(PlayerRemote *player, const c8* configfile, vector3df location, vector3df rotation, vector3df scale)
	{
		CCal3DSceneNode *node = new CCal3DSceneNode(configfile,0,this->smgr);
		this->smgr->getRootSceneNode()->addChild(node);
		node->setPosition(location);
		node->setRotation(rotation);
		node->setScale(scale);
		node->init();
		return node;				
	};
what is missing?
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

Post by terrorchrist »

come on!
please someone tell my why my model is not viewed!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

terrorchrist wrote:please someone tell my why my model is not viewed!
Maybe no one wants to watch it :?: :lol:
If you want to know why it's not shown you might try to use the scene node the correct way. Or maybe even better use Klasker's Cal3D node as it is still supported...
I think you don't have to create the core model, this is done automatically by the scene node. Just create the node and init it. Try to introduce some output to therender functions of the scene node to check which of the three are executed. And avoid the scene node transformations (rotation etc.) at first such that no side effects will disturb the rendering.
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

Post by terrorchrist »

ok I managed to compile my app with klaskers cal3d scenenode, but i find it hard to figure out, how it is used...

is there any tutorial on this?

if not: please tell me what I have to do to load a model...
kapace
Posts: 4
Joined: Tue Nov 14, 2006 4:58 am

Cal3d

Post by kapace »

Can someone make a port for this to Ironpython or boo? it would be greatly appreaciated!!
Post Reply