• Advertisement
Sign in to follow this  

fbx tree with billboard leafs, but leaf quads are already made

This topic is 1445 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all,

 

I imported an fbx tree model into an editor I'm doing, and saw that the tree already came with the leafs as quads (tons of quads actually), and I would like those to work as billboards, and all the leaf quads come in a single modelmeshpart section. 

 

To be honest looking at the tree image I think they are way too many quads and its actually a waste of quad to put them all as billboards, but for learning purposes I would like to make them work as billboards. Is there a way to make already made quads work as billboards?

 

thanks in advance for all the help.

 

Here is an image of the tree with and without alpha blending.

 

[attachment=19742:alpha.png]

 

[attachment=19741:no alpha.png]

Share this post


Link to post
Share on other sites
Advertisement

If the quads are pre-oriented, you'll need to find a way to undo this transformation.

 

- Perhaps the orientation is stored within the mesh. Likely not, but maybe the author of the tool thought it might be useful for deformations (wind etc.).

- If the quads are uv mapped you can use that map, plus the directions of two edges on the quad to re-construct the quad's orientation (similar to what you do when normal mapping).

 

The quad's vertices multiplied by the inverse of the transformation (matrix) will give you the original quad. This you can then transform as a regular billboard.

 

Or simpler, you can take the average of the four vertices of the quad, the distance from this centroid position to one of the vertices and build a new quad.

Edited by eppo

Share this post


Link to post
Share on other sites

Those are all good ideas, I'll give it a try on trying to get the centroid, and the work on it as a regular billboard to see what comes out. Thanks for the ideas.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement