Tree Scene Node v2.1
No, that is not XML reading problem. I tested this. When tried precompiled example it always crashes.
I recompiled your source and result was the same. Then after debugging of sources found the problem points.
With these additions that I wrote above project works.
That is invoking of zero pointer problem for me. Sorry if I perplex you with my bad English.
I recompiled your source and result was the same. Then after debugging of sources found the problem points.
With these additions that I wrote above project works.
That is invoking of zero pointer problem for me. Sorry if I perplex you with my bad English.
OK, I just adapted shogun's plugin for your trees to VisualEditor.
http://irrlicht.sourceforge.net/phpBB2/ ... 8&start=60
http://irrlicht.sourceforge.net/phpBB2/ ... 8&start=60
Cound not load .irr file with tree

I created a .irr map with irrEdit, used treenode plug-in and saved as this map as tree.irr
Code: Select all
smgr->loadScene("Data\\tree.irr")
Code: Select all
#include "CTreeGenerator.h"
#include "CBillboardGroupSceneNode.h"
#include "CTreeSceneNode.h"
When I run it, after load all mesh and texture, my demo crashed!
In console window:
Code: Select all
Could not create scene node of unknown type: klaskerTreeSceneNode_0
Loaded texture: c:\users\khanh\desktop\trees\proceduraltrees\textures\oakleaf.pn
g
Did you register the factory?
You have to execute this code before loading your scene:
You have to execute this code before loading your scene:
Code: Select all
CKlaskerTreeSceneNodeFactory* factory = new CKlaskerTreeSceneNodeFactory(yourScenemanager, yourIrrlichtDevice);
yourScenemanager->registerSceneNodeFactory(factory);
factory->drop();
Texture linking with Irredit plugin
I'm trying to utilize these tree nodes using the irredit plugin, I can get the tree to load ok but am unable to figure out how to link the textures so the tree is black and the leaves are green from the shader. Any help would be greatly appreciated.
Michael Dillon
Michael Dillon
It's possible. I wrote my tree scene node for irredit around six months ago so I'll have to dig out the source and check how I handled textures.


Irrlicht Demos: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=6&t=45781
Did you change the textures in the Materials tab of the tree scenenode? The first texture is the bark, the second is the texture for the LOD far away and the third texture is for the leaves (if existing).TCNJ wrote:I'm trying to utilize these tree nodes using the irredit plugin, I can get the tree to load ok but am unable to figure out how to link the textures so the tree is black and the leaves are green from the shader. Any help would be greatly appreciated.
Here is the portion of the scene with the tree node.
Here is the tree.
Thanks for all the help.
Michael Dillon
Code: Select all
<node type="klaskerTreeSceneNode_0">
<attributes>
<string name="Name" value="" />
<int name="Id" value="-1" />
<vector3d name="Position" value="1472.615479, -45.102962, 440.503357" />
<vector3d name="Rotation" value="0.000000, 0.000000, 0.000000" />
<vector3d name="Scale" value="1.000000, 1.000000, 1.000000" />
<bool name="Visible" value="true" />
<enum name="AutomaticCulling" value="box" />
<int name="DebugDataVisible" value="0" />
<bool name="IsDebugObject" value="false" />
<int name="Seed" value="0" />
<vector3d name="LightDir" value="-0.577350, -0.577350, -0.577350" />
</attributes>
<materials>
<attributes>
<enum name="Type" value="solid" />
<color name="Ambient" value="ffffffff" />
<color name="Diffuse" value="ffffffff" />
<color name="Emissive" value="00000000" />
<color name="Specular" value="ffffffff" />
<float name="Shininess" value="0.000000" />
<float name="Param1" value="0.000000" />
<float name="Param2" value="0.000000" />
<texture name="Texture1" value="materials/AspenBark.png" />
<texture name="Texture2" value="materials/AspenBillBoard.png" />
<texture name="Texture3" value="materials/AspenLeaf.png" />
<texture name="Texture4" value="" />
<bool name="Wireframe" value="false" />
<bool name="GouraudShading" value="true" />
<bool name="Lighting" value="true" />
<bool name="ZWriteEnable" value="true" />
<int name="ZBuffer" value="1" />
<bool name="BackfaceCulling" value="true" />
<bool name="FogEnable" value="false" />
<bool name="NormalizeNormals" value="false" />
<bool name="BilinearFilter1" value="true" />
<bool name="BilinearFilter2" value="true" />
<bool name="BilinearFilter3" value="true" />
<bool name="BilinearFilter4" value="true" />
<bool name="TrilinearFilter1" value="false" />
<bool name="TrilinearFilter2" value="false" />
<bool name="TrilinearFilter3" value="false" />
<bool name="TrilinearFilter4" value="false" />
<bool name="AnisotropicFilter1" value="false" />
<bool name="AnisotropicFilter2" value="false" />
<bool name="AnisotropicFilter3" value="false" />
<bool name="AnisotropicFilter4" value="false" />
<enum name="TextureWrap1" value="texture_clamp_repeat" />
<enum name="TextureWrap2" value="texture_clamp_repeat" />
<enum name="TextureWrap3" value="texture_clamp_repeat" />
<enum name="TextureWrap4" value="texture_clamp_repeat" />
</attributes>
<attributes>
<enum name="Type" value="trans_alphach" />
<color name="Ambient" value="ffffffff" />
<color name="Diffuse" value="ffffffff" />
<color name="Emissive" value="00000000" />
<color name="Specular" value="ffffffff" />
<float name="Shininess" value="0.000000" />
<float name="Param1" value="0.000000" />
<float name="Param2" value="0.000000" />
<texture name="Texture1" value="materials/AspenBark.png" />
<texture name="Texture2" value="materials/AspenBillBoard.png" />
<texture name="Texture3" value="materials/AspenLeaf.png" />
<texture name="Texture4" value="" />
<bool name="Wireframe" value="false" />
<bool name="GouraudShading" value="true" />
<bool name="Lighting" value="false" />
<bool name="ZWriteEnable" value="true" />
<int name="ZBuffer" value="1" />
<bool name="BackfaceCulling" value="true" />
<bool name="FogEnable" value="false" />
<bool name="NormalizeNormals" value="false" />
<bool name="BilinearFilter1" value="true" />
<bool name="BilinearFilter2" value="true" />
<bool name="BilinearFilter3" value="true" />
<bool name="BilinearFilter4" value="true" />
<bool name="TrilinearFilter1" value="false" />
<bool name="TrilinearFilter2" value="false" />
<bool name="TrilinearFilter3" value="false" />
<bool name="TrilinearFilter4" value="false" />
<bool name="AnisotropicFilter1" value="false" />
<bool name="AnisotropicFilter2" value="false" />
<bool name="AnisotropicFilter3" value="false" />
<bool name="AnisotropicFilter4" value="false" />
<enum name="TextureWrap1" value="texture_clamp_repeat" />
<enum name="TextureWrap2" value="texture_clamp_repeat" />
<enum name="TextureWrap3" value="texture_clamp_repeat" />
<enum name="TextureWrap4" value="texture_clamp_repeat" />
</attributes>
<attributes>
<enum name="Type" value="trans_alphach_ref" />
<color name="Ambient" value="ffffffff" />
<color name="Diffuse" value="ffffffff" />
<color name="Emissive" value="00000000" />
<color name="Specular" value="ffffffff" />
<float name="Shininess" value="0.000000" />
<float name="Param1" value="0.000000" />
<float name="Param2" value="0.000000" />
<texture name="Texture1" value="materials/AspenBark.png" />
<texture name="Texture2" value="materials/AspenBillBoard.png" />
<texture name="Texture3" value="materials/AspenLeaf.png" />
<texture name="Texture4" value="" />
<bool name="Wireframe" value="false" />
<bool name="GouraudShading" value="true" />
<bool name="Lighting" value="false" />
<bool name="ZWriteEnable" value="true" />
<int name="ZBuffer" value="1" />
<bool name="BackfaceCulling" value="true" />
<bool name="FogEnable" value="false" />
<bool name="NormalizeNormals" value="false" />
<bool name="BilinearFilter1" value="false" />
<bool name="BilinearFilter2" value="false" />
<bool name="BilinearFilter3" value="false" />
<bool name="BilinearFilter4" value="false" />
<bool name="TrilinearFilter1" value="false" />
<bool name="TrilinearFilter2" value="false" />
<bool name="TrilinearFilter3" value="false" />
<bool name="TrilinearFilter4" value="false" />
<bool name="AnisotropicFilter1" value="true" />
<bool name="AnisotropicFilter2" value="true" />
<bool name="AnisotropicFilter3" value="true" />
<bool name="AnisotropicFilter4" value="true" />
<enum name="TextureWrap1" value="texture_clamp_repeat" />
<enum name="TextureWrap2" value="texture_clamp_repeat" />
<enum name="TextureWrap3" value="texture_clamp_repeat" />
<enum name="TextureWrap4" value="texture_clamp_repeat" />
</attributes>
</materials>
<node type="">
<attributes>
<string name="Name" value="" />
<int name="Id" value="-1" />
<vector3d name="Position" value="0.000000, 0.000000, 0.000000" />
<vector3d name="Rotation" value="0.000000, 0.000000, 0.000000" />
<vector3d name="Scale" value="1.000000, 1.000000, 1.000000" />
<bool name="Visible" value="true" />
<enum name="AutomaticCulling" value="box" />
<int name="DebugDataVisible" value="0" />
<bool name="IsDebugObject" value="false" />
</attributes>
<materials>
<attributes>
<enum name="Type" value="trans_alphach_ref" />
<color name="Ambient" value="ffffffff" />
<color name="Diffuse" value="ffffffff" />
<color name="Emissive" value="00000000" />
<color name="Specular" value="ffffffff" />
<float name="Shininess" value="0.000000" />
<float name="Param1" value="0.000000" />
<float name="Param2" value="0.000000" />
<texture name="Texture1" value="materials/tree.png" />
<texture name="Texture2" value="" />
<texture name="Texture3" value="" />
<texture name="Texture4" value="" />
<bool name="Wireframe" value="false" />
<bool name="GouraudShading" value="true" />
<bool name="Lighting" value="false" />
<bool name="ZWriteEnable" value="true" />
<int name="ZBuffer" value="1" />
<bool name="BackfaceCulling" value="true" />
<bool name="FogEnable" value="false" />
<bool name="NormalizeNormals" value="false" />
<bool name="BilinearFilter1" value="false" />
<bool name="BilinearFilter2" value="false" />
<bool name="BilinearFilter3" value="false" />
<bool name="BilinearFilter4" value="false" />
<bool name="TrilinearFilter1" value="false" />
<bool name="TrilinearFilter2" value="false" />
<bool name="TrilinearFilter3" value="false" />
<bool name="TrilinearFilter4" value="false" />
<bool name="AnisotropicFilter1" value="true" />
<bool name="AnisotropicFilter2" value="true" />
<bool name="AnisotropicFilter3" value="true" />
<bool name="AnisotropicFilter4" value="true" />
<enum name="TextureWrap1" value="texture_clamp_repeat" />
<enum name="TextureWrap2" value="texture_clamp_repeat" />
<enum name="TextureWrap3" value="texture_clamp_repeat" />
<enum name="TextureWrap4" value="texture_clamp_repeat" />
</attributes>
</materials>
</node>
</node>
Code: Select all
- <tree>
- <branch id="1">
<length min="160" max="200" />
<radius value="22" />
<radiusEnd value="0.60" />
- <child ref="2">
<position min="0" max="1" />
<orientation min="30" max="170" />
<pitch min="30" max="110" />
<count min="6" max="12" />
</child>
- <child ref="1">
<lengthScale value="0.606" />
<position value="0.95" />
<pitch min="0" max="5" />
<count value="1" />
</child>
</branch>
- <branch id="2">
<length value="100" />
<radius value="10" />
<radiusEnd value="0.50" />
- <leaf level="1">
<position value="0.95" />
<red min="210" max="255" />
<green value="255" />
<blue min="128" max="128" />
<width value="40" />
<height value="40" />
</leaf>
- <leaf level="2">
<position min="0" max="0.8" />
<red min="210" max="255" />
<green value="255" />
<blue min="128" max="128" />
<width value="40" />
<height value="40" />
</leaf>
- <child ref="2">
<lengthScale value="0.7" />
<position value="0.95" />
<pitch min="0" max="35" />
<count min="1" max="2" />
</child>
</branch>
- <branch id="3">
<length min="70" max="120" />
<radius value="22" />
<radiusEnd value="0.60" />
- <child ref="1">
<lengthScale value="0.606" />
<position value="0.95" />
<pitch min="0" max="5" />
<count value="1" />
</child>
</branch>
<root ref="3" levels="6" />
</tree>
Michael Dillon
You seem to give one of the materials three textures. That's the mistake, you should make it so that the first material has the bark-texture (in slot 1), the second material has the LOD-texture (in slot 1, too, but not really needed) and the third material has the leaves-texture (if the tree even has leaves, of course).TCNJ wrote:Code: Select all
<node type="klaskerTreeSceneNode_0"> <texture name="Texture1" value="materials/AspenBark.png" /> <texture name="Texture2" value="materials/AspenBillBoard.png" /> <texture name="Texture3" value="materials/AspenLeaf.png" /> <texture name="Texture4" value="" />
Hello,
I'm getting strange errors when using Procedural Trees with my IDE (MS VC++.NET 2008 Express). The sample project is running fine, but when I make a new project, add the Irrlicht.dll and the header and code data from the sample project, and COPY & PASTE the main.cpp's code into the new main.cpp, it doesn't work.
More precisely, I get a
After fixing that by adding the
statement, I get really strange errors like
(sorry for not-so-exact error text's, I'm using the german Visual Studio
)
and refers me to the "bool drop() const" function in the IReferenceCounted.h
I guess there is some kind of reference issue or something wrong in the project configuration but I can't find out what - so PLEASE help me
I'm getting strange errors when using Procedural Trees with my IDE (MS VC++.NET 2008 Express). The sample project is running fine, but when I make a new project, add the Irrlicht.dll and the header and code data from the sample project, and COPY & PASTE the main.cpp's code into the new main.cpp, it doesn't work.
More precisely, I get a
Code: Select all
error LNK2019: unresolved external symbol ""class irr::IrrlichtDevice * __cdecl irr::createDevice([...])" ([...])" referenced in function "_main".
Code: Select all
#pragma comment(lib, "Irrlicht.lib")
Code: Select all
Unsolved exception at 0x00413026 in TreeTest2.exe: 0xC0000005: Access violation when reading at position 0x00000004.

and refers me to the "bool drop() const" function in the IReferenceCounted.h
I guess there is some kind of reference issue or something wrong in the project configuration but I can't find out what - so PLEASE help me
