Clock hands sometimes dissappear
|
Edwin Karillion
Registered User
Join date: 17 Oct 2008
Posts: 3
|
10-17-2008 13:13
I assumed my problem was a common one, but I was not able to google it for or find it here on the forum. So, my excuse if this is common stuff. I am a builder newbe and decided to start off with a clock. To do so I followed a tutorial that explained me to: - build a clock face [ in my case 1x1m, texture 512x512 px] - build clock hands [512 x 13 px] one halve of each of the hand textures (256px) is only transparency to force the rotation center at the visible end of the hand without adding an additional prim. I did this for the hour, minute, and seconds hands.
At first it seems the clock was fine. But, when I finalized it, got out of the edit mode, and walked around I noticed that that sometimes some of the hands disappeared. This also happened when I was near the clock.
Does anyone knows what the problem is, and how it can be solved?
[Just for the sake of completeness: I run SL on a Dess Precision M65 laptop (with NVIDIA graphics) and Linux (Hardy) on it.]
Best regards,
Edwin
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
10-17-2008 13:39
So, you are putting three textures -- one for the hour hand, one for the minute hand, and one for the second hand -- in front of each other, and all of them have transparency? If so, the answer is straightforward... you have tripped into the "alpha sorting glitch" that is a feature of OpenGL. To put it simply, your graphics card can't always figure out which of the images is in front, so it defaults at some view angles to making two or more of them transparent. The only solution is ... don't do that. Read the sticky on alpha channels and transparency at the top of the Texture Tips forum for a much better (and more complete) explanation of the phenomenon.
|
Edwin Karillion
Registered User
Join date: 17 Oct 2008
Posts: 3
|
10-17-2008 13:47
From: Rolig Loon So, you are putting three textures -- one for the hour hand, one for the minute hand, and one for the second hand -- in front of each other, and all of them have transparency? If so, the answer is straightforward... you have tripped into the "alpha sorting glitch" that is a feature of OpenGL. To put it simply, your graphics card can't always figure out which of the images is in front, so it defaults at some view angles to making two or more of them transparent. The only solution is ... don't do that. Read the sticky on alpha channels and transparency at the top of the Texture Tips forum for a much better (and more complete) explanation of the phenomenon. Ah, that makes sense. I'll go through that stuff and fix it (hopefully). Edwin
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
10-17-2008 14:18
Also, does the clock face itself have any alpha in its texture? Make sure it does NOT.
When I make a round clock face, I put it on the end of a cylindrical prim. The square texture for that face is opaque all the way to the corners, and never a circle of alpha surrounding the visible face.
Rather than doing a hand texture that is half alpha, use a 24-bit hand texture, and use a prim that is cut in half, so its 'center' is at one end. Then you have no chance of alpha sort errors.
If the prims for your clock hands are linked to the rest of the clock, the alpha sort glitch should be minimal between the hands, once you have focussed your camera on the clock. Look in the Script Library forum for "Ceera's Westminster Clock" for an example of making a clock that has linked hands. My clocks have never shown any noticable alpha-sort problems between the minute hand and hour hand, even when using alpha textures on the full-disc hand prims.
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
|
Edwin Karillion
Registered User
Join date: 17 Oct 2008
Posts: 3
|
10-19-2008 11:31
From: Ceera Murakami Also, does the clock face itself have any alpha in its texture? Make sure it does NOT. When I make a round clock face, I put it on the end of a cylindrical prim. The square texture for that face is opaque all the way to the corners, and never a circle of alpha surrounding the visible face. ...
Okay, I'll try that. From: Ceera Murakami ... Rather than doing a hand texture that is half alpha, use a 24-bit hand texture, and use a prim that is cut in half, so its 'center' is at one end. Then you have no chance of alpha sort errors. ...
If I understand you correctly, you suggest me to do two things: (1) cutting the prim in half and (2) make the visible half 24-bit. When I do that (1) how do I get the hand rotated around the pivot point without adding an addition prim to link it with? (2) My hands are not rectangular, they have a point, so I assume I still need transparancy, right? From: Ceera Murakami ... If the prims for your clock hands are linked to the rest of the clock, the alpha sort glitch should be minimal between the hands, once you have focussed your camera on the clock. Look in the Script Library forum for "Ceera's Westminster Clock" for an example of making a clock that has linked hands. My clocks have never shown any noticable alpha-sort problems between the minute hand and hour hand, even when using alpha textures on the full-disc hand prims.
Indeed, your example clock had the full-size clock hand with transparency in it. So, can I conclude from this that the only 'real' problem is the square clock face with transparency. And, that I need, as you pointed out, a cilindrical prim with a 24-bit texture on it?
|
Almia Thaler
IMA Shyguy!! 0o0
Join date: 3 Jun 2008
Posts: 173
|
10-19-2008 11:47
there is also the other method
sculpt the hands
rather crude but it works
if you can get the center of the sculpt right and be able to work with the bounding box.
also
when all else fails just dimple a box apply a taper to the un-dimpled side and narrow it down and reduce its length and you'll have a modern like clock hand
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
10-19-2008 12:25
From: Edwin Karillion (1) how do I get the hand rotated around the pivot point without adding an addition prim to link it with? (2) My hands are not rectangular, they have a point, so I assume I still need transparancy, right? When you cut a prim its center remains where it was, as if you had somehow made the cutaway part invisible. Try taking a cylinder and fooling around with the begin and end values to cut it into a pie-shaped wedge. You'll see that the point of the wedge still THINKS it is at the central axis of a complete cylinder, so it should still be able to rotate around that point. If you would rather have a clock hand with a pointy tip instead of a rounded one, you can do the same trick by starting with a cube. Set the twist start and end values to 45, thus creating a diamond, and cut away most of it with path cuts that begin at 0.45 and end at 0.55. Squish the Z-dimension down and you have a pointy hand that will rotate around what USED to be the center of the cube.
|
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
|
10-19-2008 13:04
From: Ceera Murakami Look in the Script Library forum for "Ceera's Westminster Clock" for an example of making a clock that has linked hands. Hey, Ceera! I know I have seen your Westminster Clock script before in the Script Library -- when I wasn't looking for it  -- but I can't find it now. I just did a search for "Westminster" and came up empty. A search for "clock" turns up 8 entries, none of which is yours. So where is it? EDIT: Never mind. I found it. It's not in the Script Library... it's in the Scripting Tips forum --->> /54/3a/234842/1.html
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
10-19-2008 19:04
there is also another possible issue regarding the scripting of the hands, that will make them flash or dissappear on an irrgular basis.... it's in how the movement is forced to update in the viewer...
the solution I found was to make sure all moves for any part (including second hand) moved 6 degrees or more, and then the status change wasn't neccessary (mostly used opacity switching on a hidden face) to force it to be seen in the viewer.
_____________________
| | . "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... | - 
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
10-19-2008 19:44
Simple 1-prim clock hand, with no transparency:
Start with a cube prim, then change that into a sphere.
Dimple Beginning to 0.50, then change it back into a cube. You'll see the lower half of the cube is now gone.
Taper X to 1.000
Reduce Y dimension to something very thin, like 0.020.
Change X and Z dimensions as needed to make the clock hand as long and as thin as you want.
You now have a triangle, with a pivot point on the y-axis at the center of the base of the triangle.
Texture as desired, with 24-bit textures (or just blank texture and set the color to black).
(Note that my clock scripts are for rotation on the Z-axis, but that is a minor script change, to make it rotate on Y instead.)
If you use a dimple of 0.40 instead of 0.50, the pivot point will be in the fat end of the resulting triangular hand, but not right at the base of the triangle.
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
|
Infrared Wind
Gridologist
Join date: 7 Jan 2007
Posts: 662
|
02-24-2009 06:40
One thing I've found that helps is to increase the space between the stack of hands.
|