Lavos Posted May 1, 2013 Author Share Posted May 1, 2013 In my result of lack of knowledge with math i have no idea how to fix this please help me out T_T```Public Sub Build_Tile(ByVal Texture As String)Dim VA(0 To 7) As NEMO_VERTEXDim i As LongSet Mesh = New cNemo_MeshWith VA(0) .X = 0 .Y = 0 .z = 0 .tu = 0 .tv = 0End WithWith VA(1) .X = .X + 32 .Y = VA(0).Y .z = .z + 32 .tu = 0 + 32 + 1 .tv = VA(0).tvEnd WithWith VA(2) .X = VA(0).X .Y = .X + 32 .z = VA(0).z .tu = VA(0).tu .tv = 0 + 32 + 1End WithWith VA(3) .X = VA(1).X .Y = VA(2).Y .z = VA(3).z .tu = VA(1).tu .tv = VA(2).tvEnd WithWith VA(4) .X = 32 .Y = 32 .z = 32 .tu = 0 .tv = 0End WithWith VA(5) .X = .X - 32 .Y = VA(0).Y .z = .z - 32 .tu = 0 - 32 - 1 .tv = VA(0).tvEnd WithWith VA(6) .X = VA(0).X .Y = .X - 32 .z = VA(0).z .tu = VA(0).tu .tv = 0 - 32 - 1End WithWith VA(3) .X = VA(5).X .Y = VA(6).Y .z = VA(7).z .tu = VA(5).tu .tv = VA(6).tvEnd WithWith Mesh .Add_Texture Texture For i = 0 To 7 .Add_NemoVertex VA(i), 0 Next .Set_CullMode D3DCULL_NONE .BuildMeshEnd WithEnd Sub```Draws everything wrong…![](http://i.imgur.com/PHzTwpB.png)if you need more information on definitions let me know, ill post it n_n Link to comment Share on other sites More sharing options...
santa-clause Posted May 1, 2013 Share Posted May 1, 2013 If z is 0 everywhere it has to work Link to comment Share on other sites More sharing options...
Lavos Posted May 1, 2013 Author Share Posted May 1, 2013 My polygons are even Broken, they were suppose to form a square and lay flat on the matrix Link to comment Share on other sites More sharing options...
santa-clause Posted May 1, 2013 Share Posted May 1, 2013 Maybe some more info about wat this al means:.X = VA(5).X.Y = VA(6).Y.z = VA(7).z.tu = VA(5).tu.tv = VA(6).tv Link to comment Share on other sites More sharing options...
Lavos Posted May 1, 2013 Author Share Posted May 1, 2013 > Maybe some more info about wat this al means:> > .X = VA(5).X> > .Y = VA(6).Y> > .z = VA(7).z> > .tu = VA(5).tu> > .tv = VA(6).tvthat builds the second polygon(the bigger triangle) Link to comment Share on other sites More sharing options...
santa-clause Posted May 1, 2013 Share Posted May 1, 2013 Wat happens when you change.X = 0.Y = 0.z = 0.tu = 0.tv = 0To:.X =0.Y = 32.z = 32.tu = 0.tv = 0This would probably not work but you can try =PAnd a little question wath does tu and tv mean? Link to comment Share on other sites More sharing options...
santa-clause Posted May 1, 2013 Share Posted May 1, 2013 Ok if you just change the hole code to this:```Public Sub Build_Tile(ByVal Texture As String)Dim VA(0 To 7) As NEMO_VERTEXDim i As LongSet Mesh = New cNemo_MeshWith VA(0) .X = 0 .Y = 0 .z = 0 .tu = 0 .tv = 0End WithWith VA(1) .X = .X + 32 .Y = VA(0).Y .z = 0 .tu = 0 + 32 + 1 .tv = VA(0).tvEnd WithWith VA(2) .X = VA(0).X .Y = .X + 32 .z = 0 .tu = VA(0).tu .tv = 0 + 32 + 1End WithWith VA(3) .X = VA(1).X .Y = VA(2).Y .z = 0 .tu = VA(1).tu .tv = VA(2).tvEnd WithWith VA(4) .X = 32 .Y = 32 .z = 0 .tu = 0 .tv = 0End WithWith VA(5) .X = .X - 32 .Y = VA(0).Y .z = 0 .tu = 0 - 32 - 1 .tv = VA(0).tvEnd WithWith VA(6) .X = VA(0).X .Y = .X - 32 .z = 0 .tu = VA(0).tu .tv = 0 - 32 - 1End WithWith VA(3) .X = VA(5).X .Y = VA(6).Y .z = 0 .tu = VA(5).tu .tv = VA(6).tvEnd WithWith Mesh .Add_Texture Texture For i = 0 To 7 .Add_NemoVertex VA(i), 0 Next .Set_CullMode D3DCULL_NONE .BuildMeshEnd WithEnd Sub``` Link to comment Share on other sites More sharing options...
Lavos Posted May 1, 2013 Author Share Posted May 1, 2013 No luck with "z" coor. = 0im afraid the polygon will not stretch out, it draws nothing Link to comment Share on other sites More sharing options...
santa-clause Posted May 1, 2013 Share Posted May 1, 2013 Then i don't know ![:P](http://www.touchofdeathforums.com/community/public/style_emoticons/<#EMO_DIR#>/tongue.png) Link to comment Share on other sites More sharing options...
DMF Posted May 1, 2013 Share Posted May 1, 2013 oks its a flat "sqaure" or "cube"??first off u got so much there O.o… y so many axis's? you only need Z(Height) = 0 , X (Width) and Y(length) should be the size of it.If z is 0 and others look like all 0 then maybe its not the math but fact you cant have all 0's? try giving x and y numbers, like x=100,y=100.see if it runs. xD but i got no idea what .tu and .tv is O.o and since it exploded as triangles ..this might help you.>! > ']> > import the object into blender, tab into edit mode, select all, then remove doubles. Then re export Link to comment Share on other sites More sharing options...
Lavos Posted May 2, 2013 Author Share Posted May 2, 2013 > oks its a flat "sqaure" or "cube"??> > first off u got so much there O.o… y so many axis's? you only need Z(Height) = 0 , X (Width) and Y(length) should be the size of it.> > If z is 0 and others look like all 0 then maybe its not the math but fact you cant have all 0's? try giving x and y numbers, like x=100,y=100.> > see if it runs. xD but i got no idea what .tu and .tv is O.o and since it exploded as triangles ..this might help you.y is the height, z is the length, tu = x (image width) tv = y (image hieght) Link to comment Share on other sites More sharing options...
JeffSventora Posted May 2, 2013 Share Posted May 2, 2013 If you are just trying to make one plane flat plane with two triangles, do something like this.// TRIANGLE 1v[0].x = -32.0v[0].z = 32v[0].y = 0v[1].x = 32.0v[1].z = 32v[1].y = 0v[2].x = 32.0v[2].z = -32v[2].y = 0// TRIANGLE 2v[3].x = -32.0v[3].z = 32v[3].y = 0v[4].x = 32.0v[4].z = -32v[4].y = 0v[5].x = -32.0v[5].z = -32v[5].y = 0 Link to comment Share on other sites More sharing options...
Lavos Posted May 3, 2013 Author Share Posted May 3, 2013 > If you are just trying to make one plane flat plane with two triangles, do something like this.// TRIANGLE 1v[0].x = -32.0v[0].z = 32v[0].y = 0v[1].x = 32.0v[1].z = 32v[1].y = 0v[2].x = 32.0v[2].z = -32v[2].y = 0// TRIANGLE 2v[3].x = -32.0v[3].z = 32v[3].y = 0v[4].x = 32.0v[4].z = -32v[4].y = 0v[5].x = -32.0v[5].z = -32v[5].y = 0Converted:```'Triangle 1 With VA(0) .X = -32 .z = 32 .Y = 0 End With With VA(1) .X = 32 .z = 32 .Y = 0 End With With VA(2) .X = 32 .z = -32 .Y = 0 End With 'Triangle 2 With VA(3) .X = -32 .z = 32 .Y = 0 End With With VA(4) .X = 32 .z = -32 .Y = 0 End With With VA(5) .X = -32 .z = -32 .Y = 0 End With```HEY! YOU FIXED IT! Thanks man!In result:![](http://i.imgur.com/LxISs3t.png) Link to comment Share on other sites More sharing options...
JeffSventora Posted May 3, 2013 Share Posted May 3, 2013 Cool, glad it worked! Do you understand why that worked? Link to comment Share on other sites More sharing options...
Lavos Posted May 3, 2013 Author Share Posted May 3, 2013 Well sorta, its really a mess when i think about it. I know Z was the purpose of measuring distance in length, While Y = 0 to the center of the origin in the quadrant scale? bleh Honestly I can't get a clear picture how it worked just by using calculations with 32 on each plane. =/ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now