|
Luciftias Neurocam
Ecosystem Design
Join date: 13 Oct 2005
Posts: 742
|
02-06-2007 22:23
Alright, I'll make this short and sweet. I have a set of textures loaded into my inventory with particular aspect ratios that must needs be preserved. I use some textual information for dynamic building with these textures. I'd like to also extract the aspect ratio from the textures without having to tell me script this scale and use this in the dynamic building process.
I can't find any LSL hooks to get this information. Is there a way to access it? Any clever hacks?
I've heard conflicting things in world about this and was hoping someone could set me straight.
Thanks in advance,
Luce.
|
|
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
|
02-07-2007 00:47
From: Luciftias Neurocam Alright, I'll make this short and sweet. I have a set of textures loaded into my inventory with particular aspect ratios that must needs be preserved. I use some textual information for dynamic building with these textures. I'd like to also extract the aspect ratio from the textures without having to tell me script this scale and use this in the dynamic building process.
I can't find any LSL hooks to get this information. Is there a way to access it? Any clever hacks?
I've heard conflicting things in world about this and was hoping someone could set me straight.
Thanks in advance,
Luce. I am not aware of any way to get aspect ratio or other size information about a texture using LSL. A work around / fudge is to include the data in the texture name or hold it in a notecard.
|
|
Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
|
02-07-2007 09:20
The aspect ratio (and original image resolution) isn't actually stored in SL at all. SL will automatically resize your texture to the "nearest" power of two in each dimension, sometimes doing a crappy job of it in the process. So not only should you store the aspect ratios separately for your script (in the name is one good way), but you should also manually resize your textures to the nearest or most appropriate power of two in each dimension before uploading it, because you're likely to do a better job of it than SL will.
|