3D Graphics - Several problems

3D Graphics - Several problems
0.0 0


Hello, I want make a simple 2D space flying but I want to have 3D ships models. I have some problems to do that.

  1. I have problem with wrong(?) coordinates. When I model my object in blender I position it like this, because I assume that in cocos2d X axis is left-right, Y axis is up-down and Z axis is deep:
    But when I import the model it is flipped around X axis by 90degrees, so I must rotate this object. This is anoying, because when I add sprite to my model i must rotate my sprite by X axis by -90 degrees. Am I doing something wrong?
    // Okay I resolve 1 problem. I must changed that Y is my UP Axis.

  2. I want to have built-in 2D physics in my game, but I cannot position the collider right. With this code I cant even see the box (with debug draw on):

auto collisionBox = PhysicsBody::createBox(Size(3000.0f, 2000.0f), PhysicsMaterial(0.1f, 1.0f, 0.0f));

But when I run that action:

RotateBy::create(10, Vec3(0, 360, 0));

I can see huge red square blink two frames.
Any tips? I read cocos2d-x Programmer guide and it doesn’t resolve my problems.