Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Texture Problems

Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
01-21-2005 13:59
My turn to ask a question. I have a dire feeling that this time I'll be unable to script my way out.

Currently I'm piecing together the texture code for my 3D Model Importer, and this time have hit a pretty nasty speedbump. While I have it down to a science on my giant cube, I run into problems any time I have two sides that are of unequal size.

Or, in simple English:

Is there any way, script or otherwise (I'd guess script) that completely cancels out texture stretching to "fit" the size of a prim at all angles? Or, better yet, is there any way to scale a texture on more than just X and Y without affecting the size or cut of the prim itself?

I'm banking on no, but it can't hurt to ask. Until then, the texture portion of the uploader is limited to squares only. :rolleyes:
_____________________
---
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
01-21-2005 16:43
Just to eliminate the obvious, have you tryed any of the texture primitive parameters? I remember several dealing with texture scaling. Also, llGetTexture* and llSetTexture* functions may be useful to you (see the wiki), there are functions to get and set the texture's scale, rotation and offset I believe.
==Chris
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
01-21-2005 17:44
Yep, Chris, I have. For once, I'm actually stumped on this one.

I need something that will prevent textures from "warping" to meet the size of the face the prim is on, especially when rotated. If not that, something that will cancel it out instead.

So if I have a prim scaled at 2m on X and 4m on Y, and the texture is rotated 36 degrees on the face formed by X and Y, I eventually need something that will let me cancel out the warping so the texture can be, say, 2m by 2m with right angles. As I currently understand the texture system, no matter what I set, I can't achieve that at any rotation but those with LSL constants. :rolleyes:
_____________________
---
Kurt Zidane
Just Human
Join date: 1 Apr 2004
Posts: 636
01-21-2005 18:20
Well you could make an object just like the primtive in sl. And use that to define the texture for each and every prim. But that's no in sl.
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
01-21-2005 18:31
While I respect the suggestion, Kurt - that'd be just a wee bit counterintuitive. I'm kinda trying to figure out how to do this with one prim apiece, not several. :o
_____________________
---