Load terrain file

Ok, I don’t really like the terrain generator it’s not really what I like to call a great THING, so can anyone give me some code of how to load a terrain in the file type of a .obj, .blend, or .fbx(pick anything you think is best or pick another file type), remember that I don’t know Panda3d and just want to know if it’s possible to do so, I want to make a Car game. so I don’t want answers like add this to your code. just give a code example. Please #PYTHON

How big a terrain do you intend to have? Are you making something like a rally game that covers hundred of kilometres, or a track-based racing game that covers only a few hundred metres, or something in-between? (If the last of those, please specify.)

Panda has built-in support for static meshes from obj and FBX via the Assimp plugin, which I think is enabled by default these days. In other words, you should be able to load obj and FBX like you would load an EGG file. For blend files, take a look at blend2bam.

actually im planning to make a game like forza horizon but remember i dont know panda3d and did not do anything im planning to learn it in the near future.

I plan to make it a huge amount of miles im sure. I just want someone to give me some code. AS I INTEND TO…

OK I like it but, I don’t really think so

a rally game more likely, FORZA HORIZON

Okay, then you’re likely going to want some sort of terrain system, indeed.

In that case, the following section of the manual might point you to a few options that you could investigate:

no i want a loader did not help

GIVE me some code please

You want to do this using just loader? That can be done, I imagine, but for a terrain of that size it will likely involve writing your own terrain handler–likely something to handle multiple chunks, and to stitch them together at the edges, and to perform level-of-detail changes with distance.

Something like that, coded from scratch with only loader, is likely to be a rather larger module than a snippet that’s likely to be posted on a forum, I fear. It’s not likely to be just a few lines of code.

just give code

i dont know panda3d

That’s fair. But as I said, what you seem to be asking for is unlikely to be just a few lines of code.

The various terrain modules–note that there’s more than one terrain generator–linked-to on that manual page that I posted above might help by doing some of the work for you.

For myself, I’ve not used any but the GeoMipMap class, and that was a long time ago, so I don’t have code for you offhand.

fine at least copy some like included code in that link im not a great finder or even get some code from where a the link leads to another link PLEASE #PYTHON

Have you seen the samples that come with Panda3D? There is a “shader terrain” example which may be of help for producing heightfield-based terrain.

I will add, though, that if you are not willing to put in some effort to research and learn the concepts and APIs by yourself, you will not be successful. We cannot write your code for you, and a demanding attitude will not help change that.

1 Like