[DirectPython] Static mesh difficulties - .x file import
Status: Inactive
Brought to you by:
hsalo
|
From: Aleksandar K. <ale...@gm...> - 2008-11-27 18:55:30
|
Hi,
My project is simple simulation of robot movement on rectangular
board. I used Frame from d3dx and StaticMesh from d3d module. So far
only one model is presented in scene.
Problem is that textures from .x file are not shown in scene. Am I
doing something wrong in onRender() method ?
def onRender(self):
d3d.setView(self.eye, self.lookat, 6000.0, 0.7853)
d3d.setState(RS.LIGHTING, True)
d3d.setState(RS.AMBIENT, 0xffffffff)
d3d.setState(RS.SPECULARENABLE, True)
d3d.setLight(0, LIGHT.DIRECTIONAL, 0xffffffff, 500.0, (0.0, 100.0,
0.0), (0.3, -1.0, 0.3), 0.4, 0.4)
d3d.setLight(1, LIGHT.DIRECTIONAL, 0xffffffff, 500.0, (200.0,
-300.0, 0.0), (0.5, 0.5, 0.1), 0.4, 0.4)
d3d.setState(RS.FILLMODE, RS.FILL.SOLID)
d3d.setTransform( element.translation, element.rotation, element.scaling )
d3d.setState(RS.USEMESHMATERIALS, True)
element.mesh.render() #time_passed) - not for static mesh
d3d.setState(RS.FILLMODE, RS.FILL.SOLID)
self.manager.render(self.elapsedtime)
Strange thing is that same model opened with 'MeshViewer.py' sample
does not show textures, while DXViewer.exe (from directx sdk) loads
textures properly.
Textures in .x file are referenced as files
example :
Material Wood_OSB1{
0.392156862745098;1.0;0.392156862745098;1.0;;
3.2;
0.000000;0.000000;0.000000;;
0.000000;0.000000;0.000000;;
TextureFilename { "teren.xWood_OSB.jpg"; }
}
Is it possible that d3d.StaticMesh does not load properly from '.x'
file ? If so how can I contribute to fix this ?
Best Regards,
Alex
|