This project is read-only.


Aug 2, 2009 at 6:51 PM


I really like the LTree library, but I want to scale the tree and it seems impossible... I don't want to use a matrix, because the physX component of my engine creates a triangle mesh object from
the vertices in the vertex buffer (and indices). The model content processor has a property "Scale", but I'm missing smth. like this in the LTree processor... :(
Can I modify a "paramter" of the .ltree file, to scale the complete tree?
Thanks in advance!


Aug 2, 2009 at 7:34 PM

Hello Kevin,

LTrees does not support scaling trees like that. First of all you should double check if PhysX supports a matrix transform when you create the physics object. It might be called "affine transformation," if that's any help.  I'd be surprised if it doesn't support that, but I'm not familiar with PhysX so I wouldn't know.

If that fails, you can modify an .ltree file like this. Find the "Root" tag, delete it, and insert this XML piece instead (only works when the "ref" parameter was set to "root" previously):

<Root ref="scale-root"/>

<Production id="scale-root">
    <Scale scale="3.0"/>
    <ScaleRadius scale="3.0"/>
    <Call ref="root" delta="0"/>

It's written off the top of my head, so it may or may not work. It should scale the tree by 300%. Replace the "3.0" in both Scale and ScaleRadius to the scale factor you want.

In a future release I might add a way to do this more easily, but I have no plans for developing a new version any time soon.

Good luck with your project. I hope this helped.

Aug 2, 2009 at 8:02 PM


Thanks for your answer, I have looked through the methods of the physX classes, but haven't found smth. (only translate and rotate).

If I modify the .ltree file like you said, the trunk ist scaled correctly but the billdboards aren't scaled... :(


Aug 3, 2009 at 9:45 AM

Oh, well. To fix the leaves, you have to find every Leaf tag and modify the Size tag inside it. The size is typically set to 200,200 which means each billboard is 200x200 (surprise). You will have to multiply that number by the scale you want. You should also scale up the numbers in the "variation" argument.