Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
07-22-2009 08:32
From: NewspaperGuy Popstar Perhaps that would be an improvement program developers should make, cause from what i understand it is a bit trial and error and for someone that likes to make things perfect fit, that aind so cool when u are developing product lines and such You (or somebody) could probably script up something to do the math for you, if you told it the original resolution.. I suggested something that would (might) make it easier for scripts to do this sort of thing: From: SVC-2266 llGetTextureResolution please!
It would be nice to have a way for scripts to get the dimensions of a texture. This would enable things like picture frames that automatically resize to the correct aspect ratio without having to include the resolution in the texture file name.
Something like "vector llGetTextureResolution (key textureId)" that returns the resolution in x and y. Maybe even stuff the aspect ratio in .z so scripts can save a few computrons by not having to calculate it themselves. http://jira.secondlife.com/browse/SVC-2266
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
07-22-2009 10:45
Many of the questions in this thread have been addressed nicely in the Files Sizes and Formats sticky at the top of this forum. Take a look. 
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask....  Look for my work in XStreetSL at 
|
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
|
07-22-2009 11:26
From: Rolig Loon Many of the questions in this thread have been addressed nicely in the Files Sizes and Formats sticky at the top of this forum. Take a look.  You're no fun.
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!! - Go here: http://jira.secondlife.com/browse/SVC-1224- If you see "if you were logged in.." on the left, click it and log in - Click the "Vote for it" link on the left
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
07-22-2009 21:55
as a quick example (and slight correct or my previous post, because osprey has a point about working large) here's how you would do a matched texture to fit a prim with the dimensions of a sheet of notebook paper (8.5in * 11in)
first create an image that is the proper ratio (we'll use 850*1100) save that, for clarity
if a dimension is not a power of two already, calculate the first power of two above it (in our case that'll be 1024*2048, and get the ratio there of 1:2) [note: if neither is a power of two it doesn't matter whether you get the ration from taking them both up or down, but it one is, this will preserve the maximum texture information)
since we know 2048 is too big for SL to upload, we need to at least get the power of two below that for our ratio of 1:2 so the next one down is 512*1024 so we resize our saved image to that, then upload it. [note: any power of two combo with our current ratio will work as long as it preserves enough detail, so you can also use 128*512, or even 64*128 asl long as those resolutions still capture the needed detail]
we size our prim to the proper dimensions to be a sheet of paper (x=0.2794, y=0.2159, z=0.01, slice=.49/.51) and apply our texture to it, with the simple repeats of 1/1.
texture is now at original dimensions, and has the least loss of info possible for the resolution we used.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|