Big Problem!!!

Return to Scripting Issues

Big Problem!!!

Postby Jack92 » Tue May 01, 2012 12:47 pm

Hi every1, i am new to this and i just encountered a problem, this is the code: import direct.directbase.DirectStart
class World:
def __init__(self):

base.setBackgroundColor(0, 0, 0)
self.track = loader.loadModel("../Models/Track.egg")
self.track.reparentTo(render)
w=World()
run()


the Track.egg code:


<CoordinateSystem> { Z-up }
<Material> Material.001 {
<Scalar> diffr { 0.640 }
<Scalar> diffg { 0.000 }
<Scalar> diffb { 0.037 }
<Scalar> specr { 0.500 }
<Scalar> specg { 0.000 }
<Scalar> specb { 0.000 }
<Scalar> shininess { 12.5 }
<Scalar> emitr { 0.000 }
<Scalar> emitg { 0.000 }
<Scalar> emitb { 0.000 }
}

<Group> Cube {
<Transform> {
<Matrix4> {
1.000 0.000 0.000 0.000
0.000 1.000 0.000 0.000
0.000 0.000 1.000 0.000
0.000 0.000 0.437 1.000
}
}

<VertexPool> Cube {
<Vertex> 0 {
1.000 1.000 -0.563
}
<Vertex> 1 {
1.000 -1.000 -0.563
}
<Vertex> 2 {
-1.000 -1.000 -0.563
}
<Vertex> 3 {
-1.000 1.000 -0.563
}
<Vertex> 4 {
1.000 1.000 1.437
}
<Vertex> 5 {
-1.000 1.000 1.437
}
<Vertex> 6 {
-1.000 -1.000 1.437
}
<Vertex> 7 {
1.000 -1.000 1.437
}
<Vertex> 8 {
1.000 1.000 -0.563
}
<Vertex> 9 {
1.000 1.000 1.437
}
<Vertex> 10 {
1.000 -1.000 1.437
}
<Vertex> 11 {
1.000 -1.000 -0.563
}
<Vertex> 12 {
1.000 -1.000 -0.563
}
<Vertex> 13 {
1.000 -1.000 1.437
}
<Vertex> 14 {
-1.000 -1.000 1.437
}
<Vertex> 15 {
-1.000 -1.000 -0.563
}
<Vertex> 16 {
-1.000 -1.000 -0.563
}
<Vertex> 17 {
-1.000 -1.000 1.437
}
<Vertex> 18 {
-1.000 1.000 1.437
}
<Vertex> 19 {
-1.000 1.000 -0.563
}
<Vertex> 20 {
1.000 1.000 1.437
}
<Vertex> 21 {
1.000 1.000 -0.563
}
<Vertex> 22 {
-1.000 1.000 -0.563
}
<Vertex> 23 {
-1.000 1.000 1.437
}
}


<Polygon> {
<MRef> { Material.001 }
<Normal> {0.000 0.000 -1.000}
<VertexRef> { 0 1 2 3 <Ref> { Cube }}
}
<Polygon> {
<MRef> { Material.001 }
<Normal> {0.000 0.000 1.000}
<VertexRef> { 4 5 6 7 <Ref> { Cube }}
}
<Polygon> {
<MRef> { Material.001 }
<Normal> {1.000 -0.000 0.000}
<VertexRef> { 8 9 10 11 <Ref> { Cube }}
}
<Polygon> {
<MRef> { Material.001 }
<Normal> {-0.000 -1.000 -0.000}
<VertexRef> { 12 13 14 15 <Ref> { Cube }}
}
<Polygon> {
<MRef> { Material.001 }
<Normal> {-1.000 0.000 -0.000}
<VertexRef> { 16 17 18 19 <Ref> { Cube }}
}
<Polygon> {
<MRef> { Material.001 }
<Normal> {0.000 1.000 0.000}
<VertexRef> { 20 21 22 23 <Ref> { Cube }}
}
}



Problem is the next 1, i have a cube with red background in my Track.egg, exported from blender 2.62...... when i run the file, i dont get error messages but i cant see the cube......... What is the proble?..... some help here plsss :shock:
Jack92
 
Posts: 14
Joined: Tue May 01, 2012 12:40 pm
Location: România

Postby abdoo47 » Tue May 01, 2012 1:00 pm

man , there is no problem with the code, just right click on the screen and move the mouse up , the problem is that the camera is located behind the cube , you need to zoom out

the manual have a lot of good examples and demos it will help you alot
abdoo47
 
Posts: 32
Joined: Fri Aug 27, 2010 4:35 am
Location: Cairo , Egypt

Postby Jack92 » Tue May 01, 2012 1:25 pm

Thx for the advice... didnt realised that!!! Unbeliavable!!!.....Thx a lot again!
Jack92
 
Posts: 14
Joined: Tue May 01, 2012 12:40 pm
Location: România


Return to Scripting Issues

Who is online

Users browsing this forum: No registered users and 0 guests