Repeating a texture over a plane in SceneKit

前端 未结 4 1121
眼角桃花
眼角桃花 2021-02-05 17:05

I have a 32x32 .png image that I want to repeat over a SCNPlane. The code I\'ve got (See below) results in the image being stretched to fit the size of the plane, rather than re

4条回答
  •  太阳男子
    2021-02-05 17:30

    To do this in the SceneKit editor, select your plane (add one if needed) in the scene and then select the "Material Inspector" tab on the top right. Then, under "Properties" and where it says "Diffuse", select your texture. Now, expand the diffuse section by clicking the carat to the left of "Diffuse" and go down to where it says "Scale". Here, you can increase the scaling so that the texture can look repeated rather than stretched. For this question, the OP would have to set the scaling to 32x32.

提交回复
热议问题