Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Help me make my vertex floor flat T_T


Lavos
 Share

Recommended Posts

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_VERTEX

Dim i As Long

Set Mesh = New cNemo_Mesh

With VA(0)

.X = 0

.Y = 0

.z = 0

.tu = 0

.tv = 0

End With

With VA(1)

.X = .X + 32

.Y = VA(0).Y

.z = .z + 32

.tu = 0 + 32 + 1

.tv = VA(0).tv

End With

With VA(2)

.X = VA(0).X

.Y = .X + 32

.z = VA(0).z

.tu = VA(0).tu

.tv = 0 + 32 + 1

End With

With VA(3)

.X = VA(1).X

.Y = VA(2).Y

.z = VA(3).z

.tu = VA(1).tu

.tv = VA(2).tv

End With

With VA(4)

.X = 32

.Y = 32

.z = 32

.tu = 0

.tv = 0

End With

With VA(5)

.X = .X - 32

.Y = VA(0).Y

.z = .z - 32

.tu = 0 - 32 - 1

.tv = VA(0).tv

End With

With VA(6)

.X = VA(0).X

.Y = .X - 32

.z = VA(0).z

.tu = VA(0).tu

.tv = 0 - 32 - 1

End With

With VA(3)

.X = VA(5).X

.Y = VA(6).Y

.z = VA(7).z

.tu = VA(5).tu

.tv = VA(6).tv

End With

With Mesh

.Add_Texture Texture

For i = 0 To 7

.Add_NemoVertex VA(i), 0

Next

.Set_CullMode D3DCULL_NONE

.BuildMesh

End With

End 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

> 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

that builds the second polygon(the bigger triangle)
Link to comment
Share on other sites

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_VERTEX

Dim i As Long

Set Mesh = New cNemo_Mesh

With VA(0)

.X = 0

.Y = 0

.z = 0

.tu = 0

.tv = 0

End With

With VA(1)

.X = .X + 32

.Y = VA(0).Y

.z = 0

.tu = 0 + 32 + 1

.tv = VA(0).tv

End With

With VA(2)

.X = VA(0).X

.Y = .X + 32

.z = 0

.tu = VA(0).tu

.tv = 0 + 32 + 1

End With

With VA(3)

.X = VA(1).X

.Y = VA(2).Y

.z = 0

.tu = VA(1).tu

.tv = VA(2).tv

End With

With VA(4)

.X = 32

.Y = 32

.z = 0

.tu = 0

.tv = 0

End With

With VA(5)

.X = .X - 32

.Y = VA(0).Y

.z = 0

.tu = 0 - 32 - 1

.tv = VA(0).tv

End With

With VA(6)

.X = VA(0).X

.Y = .X - 32

.z = 0

.tu = VA(0).tu

.tv = 0 - 32 - 1

End With

With VA(3)

.X = VA(5).X

.Y = VA(6).Y

.z = 0

.tu = VA(5).tu

.tv = VA(6).tv

End With

With Mesh

.Add_Texture Texture

For i = 0 To 7

.Add_NemoVertex VA(i), 0

Next

.Set_CullMode D3DCULL_NONE

.BuildMesh

End With

End Sub

```
Link to comment
Share on other sites

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

> 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

If you are just trying to make one plane flat plane with two triangles, do something like this.

// TRIANGLE 1

v[0].x = -32.0

v[0].z = 32

v[0].y = 0

v[1].x = 32.0

v[1].z = 32

v[1].y = 0

v[2].x = 32.0

v[2].z = -32

v[2].y = 0

// TRIANGLE 2

v[3].x = -32.0

v[3].z = 32

v[3].y = 0

v[4].x = 32.0

v[4].z = -32

v[4].y = 0

v[5].x = -32.0

v[5].z = -32

v[5].y = 0
Link to comment
Share on other sites

> 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

Converted:

```

'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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...