Sign in to follow this  

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

This topic is 4094 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
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

This topic is 4094 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this