Beginning : Grassy Scenery

I try to do “Panda3D Manual: Loading the Grassy Scenery”. It builds, but it won’t run correctly. When I execute, a gray and empty window appears, but it immediately stops working.

I think I have correctly set my project to build in release mode, but I’m not sure. How can I make sure it build in release mode?

It says …

I have no idea why it does’nt work as in the manual. The previous “hello world” worked.

There’s the main, same as in the Panda3D manual …

int main(int argc, char *argv[]) {
    // Load the window and set its title.
    framework.open_framework(argc, argv);
    framework.set_window_title("My Panda3D Window");
    WindowFramework *window = framework.open_window();
    // Load the environment model.
    NodePath environ = window->load_model(framework.get_models(), "models/environment.egg.pz");
    // Reparent the model to render.
    // Apply scale and position transforms to the model.
    environ.set_scale(0.25, 0.25, 0.25);
    environ.set_pos(-8, 42, 0);   
    // Run the engine.
    // Shut down the engine when done.
    return (0);

You have to be comfortable reading and editing the project settings. In addition to setting your project to Release mode, which you can do from the drop-down bar at the top of the screen, you also have to remove NDEBUG from the project configuration, which you can do in the Configuration menu. I’m not sure whether this is related to your problem, but it’s certainly possible.

Of course you can choose which language you wish to develop in, but are you sure that you want to develop in C++? The C++ interface is really most useful for people who are already very comfortable with that language. If you are new to both languages, the Python interface is usually the much better choice.


Are you trying to use VSC 2010?
In this case no luck!

I tried with MSVC 2010. But since yesterday I’ve also tried with python. I can run the samples no problems, but I’m reluctant to use python; I find it’s syntaxe pretty weird. However, if panda works better with python then, so be it, I’ll use python.

Thanks for helping. I’ll try to fix the NDEBUG thing.

As the manual explains, if you wish to use C++ for Panda3D, you have to use MSVC 2008. MSVC 2010 is not supported (unless you’re willing to build Panda from source and use that).

The reason for this is that MSVC 2008 and MSVC 2010 are not compatible with each other; you have to use one compiler or the other for all the C++ code you use in the same project. And the version of Panda that we provide for download was built using MSVC 2008.

However, if there is not already a strong reason for you to use C++, I do recommend using Python. It’s a much faster language for application development–you can develop a much better application using Python than the one you would have developed in C++ in the same amount of time.