Horde3D

Next-Generation Graphics Engine
It is currently 29.11.2024, 16:40

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 29.05.2009, 02:46 
Offline

Joined: 21.08.2008, 11:44
Posts: 354
I'm trying to generate the scene node names through the Lua then get the node handles from the Horde, something similar to this :
Code:
function Init ()
   scene = {}
   for i=1, 12 do
      scene[i]={}
      scene[i].handle=findNodeHandle(envRoot, 2, "item" .. i)
   end
end

Where findNodeHandle is :
Code:
   int findNodeHandle (lua_State *L)
   {
      int StartNode=luaL_checkint(L, 1);
      int SceneNodeType=luaL_checkint(L, 2);
      const char *NodeName=luaL_checkstring(L, 3);

      if (Horde3D::findNodes(StartNode, NodeName, SceneNodeType) == 1)
         lua_pushinteger(L, Horde3D::getNodeFindResult(0));
      else Error("unable to find the node");

      return 1;
   }

This piece of code works correctly and I'm happy with that, but when I'm trying to pick the scene items and send their node handles to the Lua, node handle returned from the Horde3DUtils::pickNode differs with the ones that they were found using findNodeHandle.

For ex: If the node handle returned from findNodeHandle is 68, node handle returned from the Horde3DUtils::pickNode is 69. And here is the relation of the node handles :
Code:
new node handles = old node handles + 1

Perhaps this is a bug or something similar.


Last edited by Siavash on 29.05.2009, 08:26, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: 29.05.2009, 06:33 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Not sure what "item" stands for, but pickNode may return the Mesh Node of a model, while you are searching for a model node.


Top
 Profile  
Reply with quote  
PostPosted: 29.05.2009, 07:53 
Offline

Joined: 21.08.2008, 11:44
Posts: 354
Thanks for help, was searching for models [2]. Is it possible to name the meshes [3] through the Horde3D Editor to get the exact node handles?


Top
 Profile  
Reply with quote  
PostPosted: 29.05.2009, 08:07 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
You can change the name of the mesh nodes in the .scene.xml files. If you want to use your favorite text editor or the Horde3D Editor is up to you. Both is possible (but take note, that there is currently no stable editor version for Beta3)


Top
 Profile  
Reply with quote  
PostPosted: 29.05.2009, 08:26 
Offline

Joined: 21.08.2008, 11:44
Posts: 354
Thanks a lot dear Volker for help ^_^


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group