Modeling in Blender

First… my background. I am an experienced Python programmer, moderately experienced with Blender and brand new to Panda3D.

I am trying to create a landscape in Blender that I can use in Panda. The ground is a mesh plane, subdivided several times, colored, textured and edited to give it some character. For the sky, I created a mesh sphere, deleted the bottom half and put a JPG image on the inside as a texture, after flipping the normals. In Blender, it all looks good and renders very well.

When I finally found a .X exporter that handles JPG textures, I exported it and used x2egg to make it ready for Panda. However, when I load it into Panda, the sky texture doesn’t look right and appears to be on the outside of the sky sphere. When I move the camera to the inside, it is flat gray.

Any help resolving this would be greatly appreciated. Alternatively, other methods of getting the same results would be welcome. I am using a JPG texture on the sky because, in the final version of the program, I need to be able to place “landmarks” that appear to be way out at the horizon and unapproachable by any “actors”.

As I understand it, this would probably be lots easier if the Scene Editor were working.

Thanks for any help.

Have you changed faces normals in blender? In Mesh Tools 1 you can turn “draw normals” option.
Other thing is setFar: base.camLens.setFar(10000) should incrase drawing distance, you sky can simply be beyond it. I think setFar has some upper limit anyway, but I’m not sure. Mine micro sky about 10m radius hemisphere with inside jpg texture worked fine. Exported with drWiggly’s exporter.

Thanks for the suggestions, but they don’t seem to help. In Blender, I get a nice render of a grassy terrain, with a depression in the center, like a sink-hole, with a cloudy sky in the distance. In Panda, I see the plane, but the green is on the bottom instead of the top, and the sky sphere is very small and tilted 90 degrees so that it intersects the middle of the ground plane. It’s hard to tell about the sky texture, but it still seems to be on the outside.

Thanks.

If the sky sphere is just one polygon thick (and not two layers of polygons back to back), then the texture must be on both sides–textures are always on both sides of a polygon; there’s no such thing as a polygon that has a texture on one side and a flat color on the other.

However, it is likely that the sky sphere is invisible from one side, and you may be seeing through it to the gray background color. This happens because of the vertex winding order, which is to say, each of the polygons should be drawn with the vertices in counterclockwise order as seen from the front of the polygon.

The converters should properly wind the polygons according to the information that Blender is supplying about which side is the “front” of the polygons. Sometimes converters screw this up, especially if you do something unusual to a polygon (like invert its normals, which may not completely invert the polygon as far as Blender is concerned).

Three possible solutions occur to me.

(1) Try harder to invert the polygons in Blender using some other method.

(2) Try a different converter. There are some posts elsewhere in this forum from a couple of different people who are working on a direct blender -> egg converter.

(3) In Python, tag the sky sphere to be double-sided, like this:


sky.setTwoSided(True)

With this setting, it will not be invisible from either side, so it won’t matter which direction the converter made the polygons face.

David

Thanks for the suggestions. Here are the results;

  1. I have tried every method I can find to invert the polygon with no change in
    the Panda results.

  2. I have tried the only two direct Blender->egg exporters that I can find.
    Neither seems to handle JPG textures. I have also tried three different
    Blender->X exporters and only the last one (DirectX9) handles the JPG textures.

  3. I am exporting the entire Blender scene as one X file so there is no object
    called “sky”. Would it be better to export the ground as one X file and the
    sky as another?

Thanks again for all the help. Also… if you have a better suggestion for
how to create landscapes for Panda, I am open to changing. I’ve looked at
Terragen and am very impressed with it. It seems that it too, however, would
also require some conversion of the objects.

But, at this point, I’m willing to try just about anything.

ken

About the skydome mesh, how did you deleted the bottom half ?
If you performed a boolean operation to remove it, try to triangulate the result in Blender, or Panda will triangulate it for you, which can cause unexpected polygons result.

I even tried creating a whole sphere and not deleting half of it. When I scaled it up, I got the same results; what appeared to be “hole” in the center.

ken

Gray ‘hole’ in the center ? Then it’s the far clip of the camera, adjust it to a large number, e.g. 100000 or more :


base.cam.getLens().setNearFar(1,100000)

You must name your skydome yourself in Blender (if possible).

hi there,

a gray hole in the center could be due to the NEAR clipping plane… the hole should close when you move away from the terrain.

if it comes to the blender workflow:
create the primitives and edit them like usual.

-scale and rotate your models in edit mode can avoid problems with some exporters (using skeleton&animations can give you even more trouble at this point).

-double-check the normal-directions. for the ground they should look skywards and for the sky the should go groundwards.
flip normals with
editmode->select all faces/vertices->w,9
press F9 and activate the “Draw normals” button in the lower right… to visualize those nasty little things, and scale them up.

-for texturing, the x-exporter dosent care about the image-format so you can use anything as long as panda loads the texture file.

!!use the UV-editor to generate AND apply textures to your models (material editor wont work with the x-expoerter (at least not with mine).

-dont use more different textures on one model than your graficcard supports (usualy from 2 to 8 textures. mine is 4).adding more textures will result in untextured modellparts.

i got problems with long texture names, the exporter wont write all of it down into the x file but you can still change the texture name in the x file… no problem.

use pview to check your modell.

i have 2 x exporters listed in blender, dunno where they are comming from but the lower one works the one “DirectX(.x)" … not the "DirectX (.x)” … see the empty space after the X

if you still have problems just send me the blend file and i’ll check it for you.
, perhaps you just need to use the other x-exporter ,i can upload it if you dont have it, dont know where i picked it up.

if you have terrain-trouble feel free to ask me (pm/icq)… i’m also thinking a lot about it lately.