Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I want to draw a terrain for a 2d game, and this terrain is defined by some rotated rectangles and circles, I want to draw my terrain as if it was a repeating texture clipped by those forms. I already modified the cocos2d draw primitives methods to draw them using a triangle fan, but I'm not sure how to apply a texture on them.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Very difficult to make out what it is you are asking from this question.

1) The one thing you might allude to would be the UV wrap mode on a mesh. You bind the texture, render the mesh (of course, depending on ES2.0 shaders or fixed function ES1.1), and make sure the wrap mode is set to repeat, not clamp.

Also, for more thorough information, read this page : http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-part-6_25.html

share|improve this answer
    
I want my uv mapping being relative to the level, like the inverse of this: stackoverflow.com/questions/1383937/… And my level is bigger than the screen so scroll around. –  vshade Dec 10 '10 at 16:57
    
I used some multiple of my vertex position to my texture mapping, thanks for the link. –  vshade Dec 22 '10 at 1:44
    
No problem, glad to have helped. –  underscorediscovery Dec 23 '10 at 1:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.