如何在程序中设置UV通道比例[SceneKit Xcode]

时间:2015-11-25 04:08:35

标签: ios scenekit texture-mapping

在SceneKit中,我想在对象的整个表面上应用一个小纹理,但纹理被拉伸覆盖,而不是作为块堆积。喜欢这个

enter image description here

这就是我想要的:

enter image description here

然后我发现你可以将uv通道的比例设置为6或更大,以使纹理堆积在一起。如下:

enter image description here

框架是否提供了一些api来设置程序中的属性? 我google了很多,没有运气!

1 个答案:

答案 0 :(得分:1)

是的,相应的API在SCNMaterialProperty上:

files1 <- list.files(path = "facebookdata1/", pattern="\\.csv$")
files2 <- list.files(path = "facebookdata2/", pattern="\\.csv$")
if(length(setdiff(files1, files2))>0)
  stop("Actually, the two directories do not have the same files")

for (file in files1) {
  varname <- substr(file, start=1, stop=nchar(file)-4)
  data1 <- read.csv(file.path("facebookdata1", file))
  data1 <- read.csv(file.path("facebookdata2", file))

  assign(varname, rbind(data1, data2))
}