从 wwj 中抠星星

try {
float r, g, b, x, y, z;
String strR, strG, strB, strX, strY, strZ;
StringBuilder builder = new StringBuilder();
DecimalFormat decimalFormat = new DecimalFormat("#.000000");
builder.append(numStars).append(",").append(
decimalFormat.format(radius)).append("\n");
FileOutputStream stream = new FileOutputStream("C:/stars.txt");

for (int i = 0; i < numStars; i += 6) {
r = starsBuffer.get(i + 0) * 255;
g = starsBuffer.get(i + 1) * 255;
b = starsBuffer.get(i + 2) * 255;
strR = String.valueOf(r);
strR = strR.substring(0, strR.indexOf("."));
strG = String.valueOf(g);
strG = strG.substring(0, strG.indexOf("."));
strB = String.valueOf(b);
strB = strB.substring(0, strB.indexOf("."));
x = starsBuffer.get(i + 3);
y = starsBuffer.get(i + 4);
z = starsBuffer.get(i + 5);
strX = decimalFormat.format(x);
strY = decimalFormat.format(y);
strZ = decimalFormat.format(z);

builder.append(strX).append(",").append(strY).append(",")
.append(strZ).append(",").append(strR).append(",")
.append(strG).append(",").append(strB).append(",")
.append("\n");
}

stream.write(builder.toString().getBytes());
stream.close();
} catch (Exception e) {
e.printStackTrace();
}

问题是,wwj是怎么渲染出星星来的呢?

你可能感兴趣的:(C++,c,C#)