Tree Scene Node v2.1
Great work again!
I saw that CLODSceneNodeAnimator is not distributed with last update. Now when leaves are supported maybe this animator can treat branches and leaves by different way - apply LOD to branches, but keep leaves visible, so when camera is far, tree will look with lives, despite LOD of branches.
I saw that CLODSceneNodeAnimator is not distributed with last update. Now when leaves are supported maybe this animator can treat branches and leaves by different way - apply LOD to branches, but keep leaves visible, so when camera is far, tree will look with lives, despite LOD of branches.
Doesn't compile here...
That's on the line
Using VC++ 2005 Express. I could probably get this working using either resizable stl vectors or some pointer arithmetic, but perhaps someone else has a better idea .
Hope I can get this solved, the demo looks very promising...
Code: Select all
CTreeSceneNode.cpp
.\CTreeSceneNode.cpp(361) : error C2057: expected constant expression
.\CTreeSceneNode.cpp(361) : error C2466: cannot allocate an array of constant size 0
.\CTreeSceneNode.cpp(361) : error C2133: 'directions' : unknown size
Code: Select all
core::vector3df directions[radVerts];
Hope I can get this solved, the demo looks very promising...
Not possible at the moment. The tree only generates itself exactly when it needs to, so if it is LOD 1, the leaf positions for LOD 4 are still unknown. I did this to maximize performance as I'm fighting a war to keep my FPS high.I saw that CLODSceneNodeAnimator is not distributed with last update. Now when leaves are supported maybe this animator can treat branches and leaves by different way - apply LOD to branches, but keep leaves visible, so when camera is far, tree will look with lives, despite LOD of branches.
I'll include CLODSceneNodeAnimator in the zip when I get home, thanks for letting me know. It has been updated by the way, now supports linear interpolation, quadratic interpolation and constant interpolation.
Hmm.. I thought local arrays of variable size were supported by all compilers. Guess not.Using VC++ 2005 Express. I could probably get this working using either resizable stl vectors or some pointer arithmetic, but perhaps someone else has a better idea Smile.
You should be able to fix it easily like this:
Code: Select all
core::array<core::vector3df> directions;
directions.set_used( radVerts );
Uhm.. no?Klasker, can i have a picture of you ...
Yes, that did it. Well, thanks a lot for this piece of code, it's beautiful!Klasker wrote:Hmm.. I thought local arrays of variable size were supported by all compilers. Guess not.
You should be able to fix it easily like this:Code: Select all
core::array<core::vector3df> directions; directions.set_used( radVerts );
Klasker, i think would be interesting for you to look into competitors, like this:
http://www.frecle.net/treed/ (this is free tree generator addon for gile[s]), you can get new ideas of tree with leafs creating method (with less triangles)...
Here is screen:
http://www.frecle.net/treed/ (this is free tree generator addon for gile[s]), you can get new ideas of tree with leafs creating method (with less triangles)...
Here is screen:
Small update again. Generating trees should now be much faster due to a small fix suggested by bitplane. Previously it had to copy the whole vertex array every time a branch was generated. It was solved by using push_back instead of set_used (I wrongly assumed set_used would maintain an array size of 2^n).
Even LOD 7 trees are now generated instantly!
VC++ should now be able to compile it without problems (see Amarth's issue in a previous post).
Download (1.11 MB)
Even LOD 7 trees are now generated instantly!
VC++ should now be able to compile it without problems (see Amarth's issue in a previous post).
Download (1.11 MB)
.net version?
this is pretty darn awesome. would anyone object if I tried to port it to .NET?? I couldn't seem to find any reference to how you wanted this licensed...
My irrlicht-based projects have gone underground for now, but if you want, check out my webcomic instead! http://brokenboomerang.net
Update
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
- Source code rewritten from scratch, again.
- CTreeSceneNode no longer exists. Instead there is a CTreeGenerator that returns a mesh for you to display.
- You can now design your own type of trees by implementing ITreeProfile. Or you can use CStandardTreeProfile and CPineTreeProfile which I have written.
- Uses an ILODMesh interface based on IMesh, to support continous LOD without breaking Irrlicht's interface.
- Unfortunately, there are a lot of files now. 21 files now. Used to be 10.
- Download (1608 KB) source and demo application.
- See all screenshots. Pine trees can be seen below.
Niko are you thinking of adding this into irrlicht
Niko are you thinking of adding this into irrlicht?
Great job :)
Hello
I have in coporated your code into mine, it works great, I do have a wish list, i don´t know if its too early to start..
i would be great if you can pass in the ISceneNode (the camera for example) , depending on the location of the Iscenenode to the tree, the LOD will change automatically. Also , if the distance if far enough, i think we can still show the whole tree by simply showing a picture that rotates perpendicular with the character, as the character walk closer it would then switch to the tree you have.
I really need to do something like this for my own game, i'll be willing to modify your code myself... but perhaps you already have something like this going on.
thanks
I have in coporated your code into mine, it works great, I do have a wish list, i don´t know if its too early to start..
i would be great if you can pass in the ISceneNode (the camera for example) , depending on the location of the Iscenenode to the tree, the LOD will change automatically. Also , if the distance if far enough, i think we can still show the whole tree by simply showing a picture that rotates perpendicular with the character, as the character walk closer it would then switch to the tree you have.
I really need to do something like this for my own game, i'll be willing to modify your code myself... but perhaps you already have something like this going on.
thanks
Did you look at the source? Try and see the CLODSceneNodeAnimator. Right now it does exactly that, only that it only does it for the active camera. If you want it to use an arbitrary node it's a very easy fix, though.i would be great if you can pass in the ISceneNode (the camera for example) , depending on the location of the Iscenenode to the tree, the LOD will change automatically.
My code is for generating the trees models. Making it change to billboards is easy, but it has nothing to do with trees. Rocks, houses, humans, castles, etc, are also worth turning into billboards at a fair distance. I could write it, but I don't see why you would expect it in a thread about trees. Afterall, this is not "ACME Forest Creation Kit™".Also , if the distance if far enough, i think we can still show the whole tree by simply showing a picture that rotates perpendicular with the character, as the character walk closer it would then switch to the tree you have.
My code is completely independant of what you want to implement. The ILODMesh and ILODSceneNode might need a new virtual method or two depending on your approach, but you really shouldn't touch the tree generation itself.I really need to do something like this for my own game, i'll be willing to modify your code myself...