Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
itokawa <- read.table("itokawa_f0049152.txt", skip=1, nrow=25350)
x <- itokawa[,2]
y <- itokawa[,3]
z <- itokawa[,4]
#package rglを呼び出す
library(rgl)
#lim指定を行う
plot3d(x = x, y = y, z = z, xlim=c(-0.4, 0.4), ylim=c(-0.4, 0.4), zlim=c(-0.4, 0.4))
itokawa_nasa <- read.table("ver64q.tab", skip=1, nrow=25350)
x1 <- itokawa_nasa[,2]
y1 <- itokawa_nasa[,3]
z1 <- itokawa_nasa[,4]
plot3d(x = x1, y = y1, z = z1, xlim=c(-0.4, 0.4), ylim=c(-0.4, 0.4), zlim=c(-0.4, 0.4))
#3dモデルを重ね書きする時はpoints3dを使用する
points3d(x, y, z)
par(new=T)
points3d(x1, y1, z1, col="RED")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.