Some entities not rendering?

  1. 6 months ago

    This piece of code only renders the SceneLabel, but not the ScenePrimitive box. Am I missing something here?

    This was run with the goodbye_cmake branch on a Mac.

        scene = new Scene(core, Scene::SCENE_3D);
        scene->useClearColor = true;
        
        ScenePrimitive *box = new ScenePrimitive(ScenePrimitive::TYPE_BOX, 1,1,1);
        //box->loadTexture("Resources/pink_texture.png");
        box->setPosition(0.0, 0.5, 0.0);
        scene->addChild(box);
        
        label = new SceneLabel(globalPool->getMaterial("Unlit"), "Hello World", 32, globalPool->getFont("mono"), Label::ANTIALIAS_FULL, 0.1);
        scene->addChild(label);
        
        scene->getDefaultCamera()->setPosition(3,3,3);
        scene->getDefaultCamera()->lookAt(Vector3(0,0,0));
  2. fodinabor

    31 Jul 2016 Administrator

    Hey,
    as far as I know you have to set a material for the box as well..
    should be as easy as:

    box->setMaterial(globalPool->getMaterial("Unlit"));

    (I actually guess.. I'm not totally up to date with the latest changes..)

  3. Hey, @Ivan

    I'm getting an interesting effect after adding fodinabor's line to the code:
    -image-

    This is with both the SceneLabel and the box.

  4. I fixed the mesh not rendering by setting a material for the mesh to UnlitUntextured.

 

or Sign Up to reply!