Hi
I want to use billboards, where the center of the billboard is the origin.
until now the geometry for billboards gets created like this:
float halfParticleWidth = width / 2;
// get the center of particle
float x = 0;
float y = 0;
float z = 0;
// calculate all the corners of the quad
vec[0].set(-halfParticleWidth, 0, 0);
vec[1].set(+halfParticleWidth, 0, 0);
vec[2].set(+halfParticleWidth, height, 0);
vec[3].set(-halfParticleWidth, height, 0);
I was only able to adjust it my needs by changing the code to:
float halfParticleWidth = width / 2;
// get the center of particle
float x = 0;
float y = 0;
float z = 0;
// calculate all the corners of the quad
vec[0].set(-halfParticleWidth, -height/2, 0);
vec[1].set(+halfParticleWidth, -height/2, 0);
vec[2].set(+halfParticleWidth, height/2, 0);
vec[3].set(-halfParticleWidth, height/2, 0);
Is there a better way, or should I add this to IssueZilla?
It’s pretty bad to have changes in the Xith-code, because it’s for a project (Spacebomber) and you can’t request from all to change their Xith. (At least it would be really nasty)
Arne


