# Creating an area out of points then filling it with sprites.

This topic is 4380 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have no code yet but am looking more for help on implementation than anything. Basically, imagine you can place 4 points to make a square and then you want to fill that (evenly or randomly) with sprites. Given the array of points how would you go about filling it with those sprites? This needs to work with other shapes too.

##### Share on other sites
By "filling an area with sprites", do you mean you want to fill an area with a certain repeating pattern? If so, that's done using texturing usually, by drawing several polygons and texturing them with a repeating pattern.

If you could clarify, or maybe even show an image of something similar to what you want to acheive, we might be able to be more helpful.

Hope this helps.

##### Share on other sites
Here you go, my awesome Photoshop skills. The red dots are the points, the lines being the border. This is best I could quickly do it and show what I am trying to do. Basically, place many quads in the defined area, but it doesn't have to be in a specific pattern.

http://img230.imageshack.us/img230/8379/testcg3.jpg

##### Share on other sites
I think what you are trying to do is randomly place point sprites inside the convex hull formed by your red points. You can do this by using barycentric coordinates for arbitrary polygons (aka generalized barycentric coordinates). Then all you would need to do is generate some random numbers between 0 and 1 and the forementioned method would give you a 3D point to place your sprite at by taking a linear combination of the red dots.

##### Share on other sites
thanks, I will look into it and see what I come up with.

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5
JoeJ
12

• 10
• 9
• 14
• 10
• 25
• ### Forum Statistics

• Total Topics
632646
• Total Posts
3007638
• ### Who's Online (See full list)

There are no registered users currently online

×