vivendi
April 28th, 2009, 01:42 PM
Hey, with the following code i get errors for all the variables. I don't know what to do to fix it.
I have the following code:
private void generateLand()
{
int iCount = 0;
float fX, fY, fZ = 0;
float fNx, fNy, fNz = 0;
float fTu1, fTv1, fTu2, fTv2 = 0;
float fLVX, fLVZ = 0;
int iColour = 0;
Landscape = Scene.CreateLandscape();
Mesh = Scene.CreateMeshBuilder();
Mesh.LoadXFile("..\\..\\plane.x");
iCount = Mesh.GetVertexCount();
for(int i = 0; i < iCount; i++)
{
Mesh.GetVertex(i, ref fX, ref fY, ref fZ, ref fNx, ref fNy, ref fNz, ref fTu1, ref fTv1, ref fTu2, ref fTv2, ref iColour);
Landscape.SetHeight(fX, fZ, fY, true, false, false);
}
Landscape.FlushHeightChanges(true, true);
Landscape.ComputeNormals(true);
}
This is the error that i get for all the variables:
Use of unassigned local variable 'fX'
Use of unassigned local variable 'fy'
...etc
How can i have to fix this??
I have the following code:
private void generateLand()
{
int iCount = 0;
float fX, fY, fZ = 0;
float fNx, fNy, fNz = 0;
float fTu1, fTv1, fTu2, fTv2 = 0;
float fLVX, fLVZ = 0;
int iColour = 0;
Landscape = Scene.CreateLandscape();
Mesh = Scene.CreateMeshBuilder();
Mesh.LoadXFile("..\\..\\plane.x");
iCount = Mesh.GetVertexCount();
for(int i = 0; i < iCount; i++)
{
Mesh.GetVertex(i, ref fX, ref fY, ref fZ, ref fNx, ref fNy, ref fNz, ref fTu1, ref fTv1, ref fTu2, ref fTv2, ref iColour);
Landscape.SetHeight(fX, fZ, fY, true, false, false);
}
Landscape.FlushHeightChanges(true, true);
Landscape.ComputeNormals(true);
}
This is the error that i get for all the variables:
Use of unassigned local variable 'fX'
Use of unassigned local variable 'fy'
...etc
How can i have to fix this??