Tree Scene Node v2.1
ok...
erm.. excuse a n00b question...
but how do i use this to generate trees into my application?
erm.. excuse a n00b question...
but how do i use this to generate trees into my application?
One Tequila, Two Tequila, Three Tequila, Floor.
_______________________________________
ASUS P5V-VM Ultra
Intel Pentium D930
1x 2GB DDR2 Kingmax 800mhz/533mhz mb
Leadtek PX9600GT W 512MB DDR3
200GB Maxtor HDD
_______________________________________
ASUS P5V-VM Ultra
Intel Pentium D930
1x 2GB DDR2 Kingmax 800mhz/533mhz mb
Leadtek PX9600GT W 512MB DDR3
200GB Maxtor HDD
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
I'm afraid palm trees are somewhat difficult to add at the moment because of the way leaves are handled.
On another subject, I am playing with the idea of using L-systems to generate the trees, similar to the way SpeedTree does it, which is a more organic approach instead of my current recursive approach. It is still just a thought, so don't get excited yet.
On another subject, I am playing with the idea of using L-systems to generate the trees, similar to the way SpeedTree does it, which is a more organic approach instead of my current recursive approach. It is still just a thought, so don't get excited yet.
Hi,
I created an irrEdit plugin out of your Tree Scene Node (sorry, if this has been done before - I couldn't find it). Download.
In IrrEdit 0.7.1:
In Irrlicht 1.4beta:
As you can see, the trees look different, in spite of being the same one, with the same seed. I probably will investigate this.
----
Update: The plugin now works with irrEdit 1.4alpha. The seeds are now correct when importing the trees into irrlicht.
I created an irrEdit plugin out of your Tree Scene Node (sorry, if this has been done before - I couldn't find it). Download.
In IrrEdit 0.7.1:
In Irrlicht 1.4beta:
As you can see, the trees look different, in spite of being the same one, with the same seed. I probably will investigate this.
----
Update: The plugin now works with irrEdit 1.4alpha. The seeds are now correct when importing the trees into irrlicht.
Last edited by shogun on Thu Nov 29, 2007 9:25 am, edited 2 times in total.
It's very nice so far.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
Looks cool. I haven't used irrEdit myself, but I can imagine it is quite useful. Would you mind if I link to the plugin in the first post? I will mention it is made by you, of course. I hope you can fix the seed issue, though I doubt I can be of much help there.I created an irrEdit plugin out of your Tree Scene Node (sorry, if this has been done before - I couldn't find it).
(...)
As you can see, the trees look different, in spite of being the same one, with the same seed. I probably will investigate this.
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
The example uses OpenGL and it uses a GLSL shaders to draw the leaves, so it's not a D3D-issue. Did you run the precompiled file I provided (in the msvc folder) or did you compile it yourself?
In any case, it looks for its data files in e.g. "../textures", and it sounds like it can't find one of the files it is using.
In any case, it looks for its data files in e.g. "../textures", and it sounds like it can't find one of the files it is using.
Because precompiled example crashes on my home an office PC, I made some debugging after quick look on you code. Here will post what I found:
In your main function these lines are involved:
generateNewTree(); function performs tree->setup(......) method;
But executing of CTreeSceneNode::setup(...) method races with another methods that invoke empty HighLODMeshBuffer pointer initialized by setup(....) method. That is the problem - which method is faster on different PC.
So, here is a little bypass from this situation:
In CTreeSceneNode::OnRegisterSceneNode() You can add checking for HighLODMeshBuffer
Now avoid from accessing of BoundingBox through empty pointer:
In main() function:
In your main function these lines are involved:
Code: Select all
tree = new CTreeSceneNode( manager->getRootSceneNode(), manager );
tree->getLeafNode()->applyVertexShadows( lightDir, 1.0f, 0.25f );
generateNewTree();
But executing of CTreeSceneNode::setup(...) method races with another methods that invoke empty HighLODMeshBuffer pointer initialized by setup(....) method. That is the problem - which method is faster on different PC.
So, here is a little bypass from this situation:
In CTreeSceneNode::OnRegisterSceneNode() You can add checking for HighLODMeshBuffer
Code: Select all
if(HighLODMeshBuffer)
{
core::vector3df center = HighLODMeshBuffer->BoundingBox.getCenter();
AbsoluteTransformation.rotateVect(center);
center += getAbsolutePosition();
DistSQ = (campos - center).getLengthSQ();
}
Code: Select all
const core::aabbox3d<f32>& CTreeSceneNode::getBoundingBox() const
{
if(HighLODMeshBuffer)
{
BBox.reset(HighLODMeshBuffer->BoundingBox);
}
return BBox; //added class member
}
Code: Select all
if(tree->getLeafNode()) //recommended
tree->getLeafNode()->applyVertexShadows( lightDir, 1.0f, 0.25f );
Could you please point out how a race condition can occur in a single-threaded application? I didn't think so. It is not a race condition.
It sounds like it can't load the XML files in the "../trees" folder, which explains why the tree mesh is null. Did you export all the files from the .zip? Are you running the file directly, or using a shortcut with a modified "Start in"-folder?
Maybe it's a rights issue. Does the program has the privileges to read from the "../trees" folder?
It sounds like it can't load the XML files in the "../trees" folder, which explains why the tree mesh is null. Did you export all the files from the .zip? Are you running the file directly, or using a shortcut with a modified "Start in"-folder?
Maybe it's a rights issue. Does the program has the privileges to read from the "../trees" folder?