Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A sprite in the frustum with depth test enable is not being rendered. (cocos2d-x 3.2, 3.3) #10275

Open
naghekyan opened this issue Jan 29, 2015 · 0 comments
Labels

Comments

@naghekyan
Copy link

I create a HelloWorld project with cocos2d-x 3.2 or 3.3. In HelloWorld.cpp there is a sprite. I activate depth buffers on Director like this:

Director::getInstance()->setDepthTest(true);

and set sprite Z position as follows:

sprite->setPositionZ(-200.0f);

The result is that the image moves right and up. Which is clear as I have a perspective projection. So when I set now the position to (-1, -1) and change anchor point to right-bottom:

    sprite->setPositionZ(-200.0f);
    sprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_RIGHT);
    sprite->setPosition(Vec2(-1, -1));

the sprite should be visible, also because of the shift to up and right. But it doesn't. It is being culled? How can I make it be rendered as it is in the frustum and it should be visible. Is this a bug or there is a flag to change this behavior?

P.S. I have tried with camera (ActionCamera) with moving it, and when the sprite is out of the scope but still in the frustum, it is not being rendered.

@walzer walzer added this to the unplanned milestone Apr 27, 2015
@minggo minggo removed this from the unplanned milestone Aug 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants