Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. Public Property PointCoordinates() As Vector3
  2. Get
  3. Dim x As Single = 0, y As Single = 0, z As Single = 0
  4. Single.TryParse(xcor.Text, x)
  5. Single.TryParse(ycor.Text, y)
  6. Single.TryParse(zcor.Text, z)
  7.  
  8. Return New Vector3(x, y, z)
  9. End Get
  10. Set(value As Vector3)
  11. xcor.Text = value.X.ToString()
  12. ycor.Text = value.Y.ToString()
  13. zcor.Text = value.Z.ToString()
  14. End Set
  15.  
  16. Dim vectorlist as New List(Of Vector3) 'instantiate a new generic list of type Vector3
  17. Dim vectorvariable as New Vector3(x,y,z) 'instantiate your new Vector3 structure
  18. vectorlist.Add(vectorvariable) 'add the newly created Vector3 structure to your list
  19.  
  20. ForEach vectoritem in vectorlist
  21. MessageBox.Show(String.Format("X: {0}, Y: {1}, Z: {2}",vectoritem.X, vectoritem.Y, vectoritem.Z))
  22. Next
  23.  
  24. For i As Integer = 0 to vectorlist.Count-1
  25. MessageBox.Show(String.Format("X: {0}, Y: {1}, Z: {2}",vectorlist(i).X, vectorlist(i).Y, vectorlist(i).Z))
  26. Next
  27.  
  28. Public Coordinates As New List( Of Vector3 );
  29.  
  30. Coordinates.Add( PointCoordinates )
  31.  
  32. Imports System.Collections.Generic
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement