02-11-2007 09:22 AM
02-12-2007 04:30 AM
Hi
try
{
int i, j;
double[,] elementX = new double[resolution,resolution];
double[,] elementY = new double[resolution,resolution];
double[,] elementZ = new double[resolution,resolution];
double[,] colorArray = new double[25, 25];
Random random = new Random();
/*for( j = 0; j < 25; j ++)
{
for( i = 0; i < 25; i++)
{
elementX[j,i] = random.Next(1);
elementY[j,i] = random.Next(1);
elementZ[j,i] = random.Next(1);
}
}*/
double temp;
for( j = 0; j < 25; j ++)
{
temp = radius * Math.Sin(( j - resolution / 2) * Math.PI / resolution);
for( i = 0; i < 25; i++)
{
elementX[i,j] = radius * Math.Cos( 2 * Math.PI * i / resolution) * Math.Cos(( j - resolution / 2) * Math.PI / 24);
elementY[i,j] = radius * Math.Sin( 2 * Math.PI * i / resolution) * Math.Cos(( j - resolution / 2) * Math.PI / 24);
elementZ[i,j] = temp;
colorArray[i,j] = random.Next(1);
}
}
//axCWGraph3D1.Plot3DParametricSurface( elementX, elementY, elementX, null );
axCWGraph3D1.Plots.RemoveAll();
//axCWGraph3D1.Plots.Add();
axCWGraph3D1.Plot3DParametricSurface(elementX, elementY, elementZ,colorArray);
axCWGraph3D1.Plots.Item(1).Style = CW3DGraphLib.CWPlot3DStyles.cwSurfaceLine;
}
I just pass down the random array to 4th parameter , 3DGraph plots out like attachment picture.
How to use 4th parameter in this method "Plot3DParametricSurface"?
02-12-2007 04:30 AM
Hi
try
{
int i, j;
double[,] elementX = new double[resolution,resolution];
double[,] elementY = new double[resolution,resolution];
double[,] elementZ = new double[resolution,resolution];
double[,] colorArray = new double[25, 25];
Random random = new Random();
/*for( j = 0; j < 25; j ++)
{
for( i = 0; i < 25; i++)
{
elementX[j,i] = random.Next(1);
elementY[j,i] = random.Next(1);
elementZ[j,i] = random.Next(1);
}
}*/
double temp;
for( j = 0; j < 25; j ++)
{
temp = radius * Math.Sin(( j - resolution / 2) * Math.PI / resolution);
for( i = 0; i < 25; i++)
{
elementX[i,j] = radius * Math.Cos( 2 * Math.PI * i / resolution) * Math.Cos(( j - resolution / 2) * Math.PI / 24);
elementY[i,j] = radius * Math.Sin( 2 * Math.PI * i / resolution) * Math.Cos(( j - resolution / 2) * Math.PI / 24);
elementZ[i,j] = temp;
colorArray[i,j] = random.Next(1);
}
}
//axCWGraph3D1.Plot3DParametricSurface( elementX, elementY, elementX, null );
axCWGraph3D1.Plots.RemoveAll();
//axCWGraph3D1.Plots.Add();
axCWGraph3D1.Plot3DParametricSurface(elementX, elementY, elementZ,colorArray);
axCWGraph3D1.Plots.Item(1).Style = CW3DGraphLib.CWPlot3DStyles.cwSurfaceLine;
}
I just pass down the random array to 4th parameter , 3DGraph plots out like attachment picture.
How to use 4th parameter in this method "Plot3DParametricSurface"?
02-15-2007 02:05 AM
02-20-2007 08:03 PM
Hi Sgopal
Thanks very much for this, I have fixed it.
02-20-2007 08:29 PM
Hi Sgopal
When I pass "null" to the 4th parameter of Plot3DParametricSurface(elementX, elementY, elementZ, null); function,
A message " Array dimension mismatch" pop up.
Just pass a double[,] colorArray = new double[25, 25]; to it, it works.
why?
02-26-2007 03:14 AM