Texture over more then object
|
Morwen Bunin
Everybody needs a hero!
Join date: 8 Dec 2005
Posts: 1,743
|
01-14-2007 00:01
I am trying to make a background for making pictures.
I found out that the max size for an square is 10x10. So I linked 4 squares together, so I ended up with a square of 20x20 (which would be perfect for my goal). But when I add a texture to, each original square of 10x10 displays its own texture (so the texture is 4 times repeated). I would like to know if it is somehow possible that the 4 linked squares show 1 texture over its complete surface,
Morwen.
|
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
|
01-14-2007 02:34
You can use texture offset and repeats per face to make just the proper part of a texture show on it's face. For a two by two tile the repeats per face are all .5 I thought I could use my scripted tiled picture maker to get the values for a 2.2 with not much effort but Noooooo, something is screwed up in SL, the picture is tiled properly but the values shown in the offset fields aren't displayed correctly. It's too late at night, or rather too early in the morning to do arithmetic. So here's the old code made for a two by two array of square prims. float tiles = 2 ; // for a two by two array
float i; // i is the row index starting at zero float j; // j is the column index starting at zero
// i = 0; j = 0; is the top left // i = 1; j = 1; is the bottom right
default { state_entry() { // llSay(0, "Hello, Avatar!"); do not say Hello Avatar :) }
touch_start(integer total_number) { i = 0; // set this manually to the proper row index based on the position of the prim in the array j = 0; // set this manually to the proper column position based on the position of the prim in the array float starthorizontal = -1/tiles ; llScaleTexture( 1 /tiles, 1 / tiles, ALL_SIDES ); llOffsetTexture( -.5 + ( 1 / tiles / 2) + (i/tiles) , .5 - (1/tiles/2) - (j / tiles), 2 ) ; llOffsetTexture( -.5 + ( 1 / tiles / 2) + ( ((tiles - 1) - i)/tiles) , .5 - (1/tiles/2) - (j / tiles), 4 ) ;
} }
Pardon my lousy code. This applies the values on the front and back of the tiled array.
_____________________
-
So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.
I can be found on the web by searching for "SuezanneC Baskerville", or go to
http://www.google.com/profiles/suezanne
-
http://lindenlab.tribe.net/ created on 11/19/03.
Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard, Robin, and Ryan
-
|
Morwen Bunin
Everybody needs a hero!
Join date: 8 Dec 2005
Posts: 1,743
|
01-15-2007 03:09
Hmmm… somehow I don’t get this to work (and I know, I am very clumsy with this kind of things).
This is what I did: - I placed the 4 squares of 10x10 up again. - I added the texture and script to all four squares - I changed the script in every square. One with “i=0/j=0”, one with “j=0/i=1”, one with “j=1/i=0” and one with “j=1/i=1” (all scripts saved successfully without error). - I “touched” all squares so the script ran and calculated the values….
But all squares showed the right upper part of the square.
Am I doing something wrong?
Morwen.
|
Aaron Aldwych
Silver Surfer
Join date: 26 Oct 2006
Posts: 55
|
Texture across multi surfaces
01-15-2007 04:51
If the picture is not going to be changed frequently no need to script this at all.
This can all be done by setting the repeats and offsets in the simple edit screen for each of the prim surfaces that make up your display - once the offsets are set (try bottom left at -0.25 but perhaps -0.5 from memory - think of the very centre point as 0,0 - I played with this by hand and had my 30 by 20 metre picture wall sorted out in short time.
Also the persistance is worth it because once the offsets and repeats are right then you can just surface texture a "new" picture on to the same set of prims and they will all lay out correctly with no further effort.
Sorry I'm not in game at the moment (some of us pretend to work !!!) or I would do one practically for you - IM me in the evening (UK time) and I will go through it with you - and show you an example if you like - don't think Dutch time is too far ahead of UK time is it?
|
Woopsy Dazy
Registered User
Join date: 12 Nov 2006
Posts: 173
|
01-15-2007 05:05
There's 4 numbers to change in each prim. One is offset and the other one I cant remember the name of (scale? size?), they're on the same "page". Basically you scale the image to show half the original image in each direction (horizontal and vertical). Start with one prim and set the numbers on top of page to: 0.500  and 0.500 (v). That will give you a zoom-in of the image middle. Move down to offset and set them to: .500  and .500 (v). That will move the focus from the image center to one of the corners. Probably top/right or bottom/left. You've completed your first prim Experiment with the offset numbers as needed on each prim to display the correct part of the image. Negative values moves it in one direction, and positive in the other. Ex -.500 and +.500. So using offset values ++, +-, -+, -- on different prims would give you 4 correct prims. If you wanna do this with 3x3 images, use .333 (1/3). And 4x4 use .250 (1/4). Pretty obvious I guess.
|
Morwen Bunin
Everybody needs a hero!
Join date: 8 Dec 2005
Posts: 1,743
|
01-15-2007 05:21
Thank you all for the replies (also Pal Platini who placed an example in my inventory ;P). I will look tonight at all this information if I can work it all out. From: Aaron Aldwych (some of us pretend to work !!!) *looks around her office and smiles at person standing in the door* You are kidding?  From: Aaron Aldwych or I would do one practically for you - IM me in the evening (UK time) and I will go through it with you - and show you an example if you like - don't think Dutch time is too far ahead of UK time is it? If I cannot get it to work you will get a IM from me.... I believe there is 1 hour difference between the UK and NL. Morwen.
|
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
|
01-15-2007 06:03
touch_start(integer total_number) { i = 0; // set this manually to the proper row index based on the position of the prim in the array j = 0; // set this manually to the proper column position based on the position of the prim in the array float i; // i is the row index starting at zero float j; // j is the column index starting at zero
// i = 0; j = 0; is the top left // i = 1; j = 1; is the bottom right You have to set the values of i and j manually for each prim the script goes in to the proper row and column indexes as I attempted to explain in the comment sections in the code above. For the top left, i = 0 ; j =0 ; For the top right, i = 0; j = 1 ; For the bottom left, i = 1 ; j = 0; For the bottom right, i = 1; j = 1 ; If I remember or someone reminds me and no one has produced one already when I come home tonight after work I'll make up a table with values for 2 by 2 and 3 by 3 and so on arrays.
_____________________
-
So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.
I can be found on the web by searching for "SuezanneC Baskerville", or go to
http://www.google.com/profiles/suezanne
-
http://lindenlab.tribe.net/ created on 11/19/03.
Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard, Robin, and Ryan
-
|
Bree Giffen
♥♣♦♠ Furrtune Hunter ♠♦♣♥
Join date: 22 Jun 2006
Posts: 2,715
|
01-15-2007 07:37
Cough...Cough....large prim....cough....
Sorry have a bit of a cold...
|
Morwen Bunin
Everybody needs a hero!
Join date: 8 Dec 2005
Posts: 1,743
|
01-15-2007 07:55
From: Bree Giffen Cough...Cough....large prim....cough....
Sorry have a bit of a cold... Large? Sure a wall of 20 x 20m is large, but not that extradonairy large.... Or is this not what you mean? And ermm SuezanneC... I remind you  Morwen.
|
AWM Mars
Scarey Dude :¬)
Join date: 10 Apr 2004
Posts: 3,398
|
01-15-2007 08:18
You can 'obtain' a texture alignment texture. It is a series of grids with numbers on in coloured bands, like a giant ruler, making alignment easier. From my experience (although limited to making video walls) make your texture in modular sizes of 64x64 upto 1024x1024. If not then SL will round them up for you causing distortion. I would also stay away from permutations of 3x3 prims, SL doesn't handle numbers beyond 2 decimal places to well (it takes 3.333 and makes them 3.330) when calculating offsets. If your texture can stand it, try using a smaller texture of say 128x128 and placing it on a prim of 1.280x1.280 in size and then check 'stretch textures' and resize the prim to the required size. Smaller textures means faster downloads from the SL servers, although a little more work for your Client, which most can handle. Every little helps 
_____________________
*** Politeness is priceless when received, cost nothing to own or give, yet many cannot afford - Why do you only see typo's AFTER you have clicked submit? ** http://www.wba-advertising.com http://www.nex-core-mm.com http://www.eml-entertainments.com http://www.v-innovate.com
|
Maximillian Desoto
Max's Landfall Bar & Dock
Join date: 26 Apr 2006
Posts: 323
|
01-15-2007 15:06
From: Morwen Bunin Large? Sure a wall of 20 x 20m is large, but not that extradonairy large.... Or is this not what you mean? Morwen. There are ways to make prims larger than 10x10. They are a thorny issue, as LL's position on these large prims is somewhat vague. LL admits that they place an extra strain on the system, but they haven't yet banned them. Max
|
Angelique LaFollette
Registered User
Join date: 17 Jun 2004
Posts: 1,595
|
01-15-2007 17:56
From: Maximillian Desoto There are ways to make prims larger than 10x10. They are a thorny issue, as LL's position on these large prims is somewhat vague. LL admits that they place an extra strain on the system, but they haven't yet banned them.
Max Strain is Putting it Mildly, they create Lag Pools around them that are Hell to move through, and if the prim is Large enough, the Sim will Crash. Stick with Multi Prims. I did the Math, and stretched a High resolution texture over 21 Prims (Three high, by seven wide) and you couldn't see a seam, or an Offset anywhere. It's just simple Math. I did extremely poorly in Highschool math, so if I can Manage it, then i think just about anyone can. Angel.
|
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
|
01-15-2007 21:17
For a two by two tile, repeats per side is .5 on all tiles.
Top left offset horiontal -.25 Top left offset vertical .25
Top right offset horizontal .25 Top right offset vertical .25
Bottom left offset horizontal -.25 Bottom left offset vertical -.25
Bottom right offset horizontal .25 Bottom right offset vertical -.25
----------------------
Putting this script in four prims, adding lines to make it display the values, needed only because the values the script sets aren't correctly displayed in the texture tab, and waiting and waiting for the scripts to save, reminds me of why I stopped scripting.
Darn thing still has an hourglass. I had to redo the scripts several times, following seemingly successful saves, the scripts reverted to previous behavior and displayed previous text in the script editor. They unsaved themselves. Been like that for years now. Even without this reversion problem, the time required to save a short script, only 10 or 20 lines long, is intolerable. I don't see how anyone can possibly tolerate writing a complex script using the LSL editor if the system performs as badly for them as it does for me. But I digress.
_____________________
-
So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.
I can be found on the web by searching for "SuezanneC Baskerville", or go to
http://www.google.com/profiles/suezanne
-
http://lindenlab.tribe.net/ created on 11/19/03.
Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard, Robin, and Ryan
-
|
Morwen Bunin
Everybody needs a hero!
Join date: 8 Dec 2005
Posts: 1,743
|
01-16-2007 00:14
From: Angelique LaFollette Strain is Putting it Mildly, they create Lag Pools around them that are Hell to move through, and if the prim is Large enough, the Sim will Crash. Stick with Multi Prims. I did the Math, and stretched a High resolution texture over 21 Prims (Three high, by seven wide) and you couldn't see a seam, or an Offset anywhere. It's just simple Math. I did extremely poorly in Highschool math, so if I can Manage it, then i think just about anyone can.
Wel, someone dropped me such an item into my inventory yesterday. I didn't use it because I was not sure about it... and on other side, I was way too happy that I had finally the texture displayed perfectly over the 4 surfaces (thanks everyone). I am not interested in more lag or crashing sims, so I stick to the current solutions which works wonderful. Morwen.
|