我有我似乎無法找到那個是更有效地我目前的想法有點當下不同的解決方案的問題。由隨機產生的線分開的紋理
我正在用XNA這將對移動沿着一個隨機生成的路徑的小遊戲,但我不知道該怎麼紋理分離的上方和下方線條,因爲線是隨機生成的。我希望本圖片說明問題:
所以線(S)隨機加入。我自己的想法是創建許多不同高度的矩形,並將它們放在一起,但我認爲這樣做效率有點低,並且也會迫使我的線條變得足夠厚,以致矩形可能會更寬一些比只有1-2像素,否則你可能會看到線附近的一些「emtpy」斑點。
如果有不清楚的地方,請隨時提問,我將它添加到這個問題,但我想我的問題應該是很清楚。
你是如何表示線條? – neeKo
這些線條將是小圖像(比如10x30像素),它們將以一個隨機角度旋轉並相鄰放置。 – phil13131
不要加:旋轉的角度很可能是-0.2至0.2弧度和兩個adjecent線旋轉之間的角度差將不大於0.1弧度 – phil13131