billboard

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Cristiano87
Posts: 13
Joined: Wed Oct 03, 2007 9:00 am
Location: Milano, Italia

billboard

Post by Cristiano87 »

how can i set a billboard with a part of a texture instead of the full texture?
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

depends on what you want... ;)
in general you have to use a texture with dimensions in power of 2 (2^n) !!!

1st do you have such a texture and only one smaller billboard in it, or
2nd do you have such a texture with many billboards in it ???

in 1st case you can make the unused area simply transparent...
in 2nd case you can create a new texture "on the fly" and copy the wanted part from the other texture to it (probably then go to 1st case)...

for copy texture parts, there are threads in the forum, for sure... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I would change texture coords, it's pretty simple to get only a small part from the whole texture then. And it's only four vertices, so four texture coords.
Cristiano87
Posts: 13
Joined: Wed Oct 03, 2007 9:00 am
Location: Milano, Italia

Post by Cristiano87 »

i can do it with opengl but i don't know how to do with irrlicht :(
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

hybrid wrote:I would change texture coords, it's pretty simple to get only a small part from the whole texture then. And it's only four vertices, so four texture coords.
Sure, but IBillboardSceneNode doesn't have any methods that expose the UVs. It would be handy if it did, and while we're at it, it could really do with supporting axis alignment as well.

Ah, rather than talk about it, I'll just do it.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Isn't there an axis aligned billboard patch available which is scheduled for Irrlicht 1.5 :)
Cristiano87
Posts: 13
Joined: Wed Oct 03, 2007 9:00 am
Location: Milano, Italia

Post by Cristiano87 »

i can't wait until 1.5 :lol:
i'm going to extend the class :)
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

hybrid wrote:Isn't there an axis aligned billboard patch available which is scheduled for Irrlicht 1.5 :)
It rotted, and my whims have changed anyway; I've extended the IBillboardSceneNode instead. ;)

Patch uploaded, ready for the laugh test. Example 12, TerrainRendering, demonstrates the new functionality.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply