• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

3DS Max Texture Question

Status
Not open for further replies.
Level 12
Joined
Feb 23, 2008
Messages
587
I have a texture I apply to a plane and works just great. (See Image Support).
When I use this plane (model), in the game I need to be able to set its width and height, and have it keep the images scale according to the width of the plane and repeat going down the plane. I will be creating many of these on the fly and wont know the length and width of this in-till the game is running.

Better exampled in Goal Image below.

Any thoughts? Or am i going about this all wrong? I am assuming i can set the length and width of it. I know i can scale it.. If i am going about this wrong, any suggestions on how i should go about this.


More Info:

These Are Support Beams for roller coaster maker. this will handle 0,15,30,45,60,75 pitch angles. and for the non 0 angles will have in additional texture between this and the track. Currently using webGL.
 

Attachments

  • support.PNG
    support.PNG
    35.3 KB · Views: 170
  • Goal.png
    Goal.png
    53.1 KB · Views: 155
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
This should be in the programming section, it is not relevant to 3ds Max.

The size of your geometry doesn't matter, what matters are your texture coordinate, since textures use them to define their mapping on your geometry. You can change the size of the geometry in any way you want, but as long as the texture coordinates wont change, the texture will stretch together with the geometry.

As to repeat, you need to set the appropriate wrap modes on your texture, something like this:
JavaScript:
// assuming your texture is bound to the currently active texture unit
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
Note that S and T are equivalent to X and Y, or horizontal and vertical respectively.

To actually see the texture repeating, change your texture coordinates such that their value is greater than 1 in the direction you want to repeat, or Y in this case.
That is, if your texture coordinates go from 0 to 2 on the Y axis, the texture will be shown twice in the Y direction, and so on.

/Edit
Looked and saw you are using Three.js, so check how to change texture wrap modes and changetexture coordinates there.
 
Status
Not open for further replies.
Top