Jump to content
  • Advertisement
Sign in to follow this  
SweetToothKane

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!