rgl is a 3D visualization system based on OpenGL. It provides a medium to high level interface for use in R, currently modelled on classic R graphics, with extensions to allow for interaction.
Reverted all formatting changes. Code change shown below:
endian <- if (format == "little_endian") "little" else "big"
if (nrow(Vertices)) {
for (i in seq_len(nrow(Vertices))) {
writeBin(as.numeric(Vertices[i,]), con, size=4, endian=endian)
if (withColors)
writeBin(as.integer(Colors[i,]), con, size=1, endian=endian)
}
}
Original code threw: Error in Colors[i, ] : subscript out of bounds when setting withColors = FALSE with endian formats.
endian <- if (format == "little_endian") "little" else "big"
if (nrow(Vertices)) {
if (!nrow(Colors))
writeBin(as.numeric(t(Vertices)), con, size=4, endian=endian)
else {
for (i in seq_len(nrow(Vertices))) {
writeBin(Vertices[i,], con, size=4, endian=endian)
writeBin(Colors[i,], con, size=1)
}
}
}
Issue #425
Reverted all formatting changes. Code change shown below:
Original code threw: Error in Colors[i, ] : subscript out of bounds when setting
withColors = FALSE
with endian formats.