Deanfred Brandeis
one who programs
Join date: 20 Aug 2006
Posts: 20
|
08-31-2006 20:57
I'm not trying to do anything complicated. I just want to upload some of my photos to display them *as photos* (i.e., on a wall in a frame) in SL.
My assumption is that the way I do this is to upload the image, and apply it as a texture to a flat object, that I then place where I want. (Framing is another issue, but not too difficult, I don't think.)
It seems, though, that SL resizes any image I upload to a 1:1 aspect ratio. My images are pre-cropped and at various aspect ratios. I don't mind re-cropping them to 1:1, but I've noticed many images on a single prim in other aspect ratios. How do you do this?
Here's an example of what I want to do. I have an image sized at 256x134 pixels (resized from a much larger image, but with the same aspect ratio). I upload it to SL, and SL resizes it to 134x134 but squishes it horizontally. How do I keep the original aspect ratio and then apply to an object appropriately?
|
Candide LeMay
Registered User
Join date: 30 Dec 2004
Posts: 538
|
09-01-2006 00:11
Textures are always resized* to have dimensions of powers of two - 8, 16, 32, 64, 128, 256, 512, 1024 ...
... so it's better if you do that yourself before upload. Your particular example would be resized to 256x128 during upload. To display it with correct aspect ratio you just scale the prim you put the texture on - 256/134 = 1.91. So if you make a cube 1.91m wide and 1m high and put the texture on it, the image will have correct aspect ratio.
*better word is probably resampled - the aspect ratio of the original is kept intact, it just gets squeezed or stretched to fit into the numbers I listed above. SL doesn't crop or pad pixels
_____________________
"If Mel Gibson and other cyberspace writers are right, one day the entire internet will be like Second Life." -- geldonyetich
|
Deanfred Brandeis
one who programs
Join date: 20 Aug 2006
Posts: 20
|
09-01-2006 00:53
I think I figured this out--or at least a mild hack that works really well.
Basically, you just upload the image in its original aspect ratio (of course at a smaller size than the original photo). Then you create an object in that aspect ratio, apply the image as a texture, and make it repeat only once per face. I'm not sure if SL stores the image in the original aspect ratio, but scaling the image back to its original aspect ratio looks pretty good.
For example, if your scaled down image is 256x134 pixels, you divide 256 by 134, which will give you an aspect ratio of 1.908:1. Then you create, for example, an object of size 3.816x2 meters, apply the image as a texture, and input "1" in both U and V axes in "Repeats per Face".
|
Deanfred Brandeis
one who programs
Join date: 20 Aug 2006
Posts: 20
|
09-01-2006 00:56
From: Candide LeMay Textures are always resized* to have dimensions of powers of two Are you sure that's true? Per my last post I've uploaded several images with only one dimension as a power of two--and the other whatever it scaled to when resizing--and when I apply them to a texture of the appropriate size, they look fine. It appears to me that SL merely (resamples and) displays your image by default as a square but perhaps keeps it stored with the original dimensions.
|
Kyrah Abattoir
cruelty delight
Join date: 4 Jun 2004
Posts: 2,786
|
09-01-2006 01:00
no way, always power of 2
_____________________
 tired of XStreetSL? try those! apez http://tinyurl.com/yfm9d5b metalife http://tinyurl.com/yzm3yvw metaverse exchange http://tinyurl.com/yzh7j4a slapt http://tinyurl.com/yfqah9u
|