Tree Scene Node v2.1

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Postby etcaptor » Mon Apr 17, 2006 7:09 pm

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.
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
etcaptor
 
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla

Postby Amarth » Tue Apr 18, 2006 9:07 pm

Doesn't compile here...
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

That's on the line
Code: Select all
core::vector3df directions[radVerts];

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...
Amarth
 
Posts: 4
Joined: Tue Apr 18, 2006 9:00 pm

Postby Yeurl » Tue Apr 18, 2006 11:28 pm

Klasker, can i have a picture of you ... you are my GOD !!!

exelent work ;)
Yeurl
 
Posts: 31
Joined: Thu Apr 13, 2006 9:34 am

Postby Klasker » Wed Apr 19, 2006 12:30 pm

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.

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'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.

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.
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, can i have a picture of you ...

Uhm.. no? 8)
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

Postby Amarth » Wed Apr 19, 2006 6:26 pm

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 );

Yes, that did it. Well, thanks a lot for this piece of code, it's beautiful!
Amarth
 
Posts: 4
Joined: Tue Apr 18, 2006 9:00 pm

Postby afecelis » Wed Apr 19, 2006 6:47 pm

simply amazing! :shock: :shock:

and I like those names...klasktrees/bitgrass, heheheh they even sound commercial. :wink:
afecelis
Admin
 
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia

Postby puh » Sun May 07, 2006 7:59 am

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:
Image
puh
 
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Postby Klasker » Thu May 11, 2006 4:28 pm

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! :D
VC++ should now be able to compile it without problems (see Amarth's issue in a previous post).

Download (1.11 MB)
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

.net version?

Postby buhatkj » Mon May 15, 2006 4:23 am

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
User avatar
buhatkj
 
Posts: 444
Joined: Fri Dec 12, 2003 4:53 am

Postby Klasker » Mon May 15, 2006 10:02 am

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...

Not at all, go ahead. There isn't really any license, though credit will be appreciated.
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

Postby Klasker » Sat May 20, 2006 6:45 pm

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.

ImageImage
ImageImage
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

Postby niko » Sun May 21, 2006 1:41 pm

Woha! Pretty impressive.
User avatar
niko
Site Admin
 
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria

Niko are you thinking of adding this into irrlicht

Postby juliusctw » Sun May 21, 2006 7:54 pm

Niko are you thinking of adding this into irrlicht?
juliusctw
 
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am

Great job :)

Postby juliusctw » Wed May 24, 2006 7:07 pm

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
juliusctw
 
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am

Postby Klasker » Wed May 24, 2006 9:37 pm

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.

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.

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 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™".

I really need to do something like this for my own game, i'll be willing to modify your code myself...
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.
Klasker
 
Posts: 230
Joined: Thu May 20, 2004 8:53 am

PreviousNext

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest

cron