Hi,
Recently discovered the gl::drawBillboard feature and I have been trying to get it to work and have no idea why I can not get the texture to show on a billboard.
I can see the geometry, its just untextured.
I have made a simplest example below and if someone could give me heads up where I am going wrong I would appreciate it.
#include “cinder/app/App.h”
#include “cinder/app/RendererGl.h”
#include “cinder/gl/gl.h”using namespace ci;
using namespace ci::app;
using namespace std;class CinderProject1App : public App {
public:
void setup() override;
void update() override;
void draw() override;
private:
CameraPersp mCam;
gl::TextureRef bbTex;
};void CinderProject1App::setup()
{
mCam.lookAt(vec3(3, 2, 4), vec3(0));auto img2 = loadImage(loadAsset(“CARROT2.png”));
bbTex = gl::Texture::create(img2);
bbTex->bind();gl::enableDepthWrite();
gl::enableDepthRead();
}void CinderProject1App::update()
{
}void CinderProject1App::draw()
{
gl::setMatrices(mCam);gl::clear(Color(0.2f, 0.2f, 0.2f));
glm::vec3 bbup, bbright;
mCam.getBillboardVectors(&bbright, &bbup);bbTex->bind();
gl::drawBillboard(glm::vec3(0.0f, 0.0f, 0.0f), glm::vec2(1.0f, 1.0f), 0.0, bbright, bbup,cinder::Rectf(0.25f, 0.25f, 0.75f, 0.75f));
bbTex->unbind();}
CINDER_APP( CinderProject1App, RendererGl )