Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

If you have any questions, reports, suggestions, or requests about Live2D, please send them to this forum.
※We cannot guarantee statements or answers from Live2D staff. Thank you for your understanding in advance.
 
Live2D Cubism
Cubism Products and Downloads
Cubism product manuals and tutorials
Cubism Editor Manual    Cubism Editor Tutorial    Cubism SDK Manual    Cubism SDK Tutorial

how to implement live2d clip?

edited February 2016 in Archive
hey there,
how to implement a live2d object clip in cocos2d-x? For example, if i just want a single part of a live2d character(Maybe head).

i tried using glscissor like this:

void LAppLive2DManager::onUpdate()
{
live2d::DrawProfileCocos2D::preDraw();

{
glEnable(GL_SCISSOR_TEST); <<======================
glScissor(300, 400, 100, 100); <<======================
}

L2DMatrix44 projection;
Director* director=Director::getInstance();
Size window=director->getWinSize();
projection.scale(1, window.width/window.height);

if (viewMatrix!=NULL)
{
projection.append(viewMatrix);
}

for (int i=0; iupdate();
model->draw(projection);
}

glDisable(GL_SCISSOR_TEST); <<======================

live2d::DrawProfileCocos2D::postDraw() ;
}

however,it didn't work. Did i use it in a wrong way, or should i try other solutions?

thanks
Tagged:
Sign In or Register to comment.