Jump to content

Texture zoom :: llSetLinkPrimitiveParamsFast


MIVIMEX
 Share

You are about to reply to a thread that has been inactive for 1070 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello, please help with the script. I make a speedometer and a compass and I decided to make them square planes. Script uses llSetLinkPrimitiveParamsFast. I got this texture repeats on corners. I decided to reduce the scale a little and leave a blank space on the sides so that when rotating at the corners the texture does not repeat. But I need to set the zoom. What do I need to add to this line to make it happen? Thanks a lot for any help.

if(COMPASS_PRIM) llSetLinkPrimitiveParamsFast(COMPASS_PRIM, [ PRIM_TEXTURE, 1, "32865340-5893-3e24-c4a0-b511d39246c3", <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, PI_BY_TWO]);
  .....................................................................

llSetLinkPrimitiveParamsFast(COMPASS_PRIM, [PRIM_TEXTURE, 0, "c6a241dd-709a-bf10-e7d0-b2bf49930d2a", <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>, our_direction_angle_rad * -1]);

 

Snapshot_003.png

Snapshot_004.png

Link to comment
Share on other sites

41 minutes ago, MIVIMEX said:

What do I need to add to this line to make it happen? Thanks a lot for any help.

 You need to add a properly made texture, that has enough blank space around it on ALL four sides so that it can be rotated without the edge of the texture being inside the "square plane"...

Or...

Throw away the square planes and replace them with circular ones...

...

This is a texture/build error not a script error. You basically cannot fix this with scripting.



 

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Klytyna's right.  Remake the texture or use a circular prim instead of a square one.

And if you ever do  want to change the scale on a texture, I think you'll find that the easiest way to get the right numbers is to do it manually and then just copy the numbers from your editor into the script.

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

I just increased the texture and changed the line as follows.

llSetLinkPrimitiveParamsFast(COMPASS_PRIM, [PRIM_TEXTURE, 0, "78300a1f-a19d-3b47-48c3-c3b4758a11ed", 


<.35, .35, 0.0>, ///// <<< Maybe someone is interested in - the scale varies here
  
  
  <0.0, 0.0, 0.0>, our_direction_angle_rad * -1]);

 

Snapshot_003.png

Snapshot_004.png

x.jpg

  • Like 1
Link to comment
Share on other sites

I see you've fixed it, but I'll comment anyway. Switching to a circular prim requires only in-world effort, so you did the easier thing. You also did the right thing, as it makes best use of your texture space, potentially allowing you to reduce the resolution of your texture.

If you choose to scale your texture, you'd reduce the compass rose image to 70% of full size (where the compass image extends to the edges of the texture), and fill in the newly created empty edge space with your background color. 70% is just a hair less than the ratio (.707) of the texture's diagonal (where your overlap is occurring) to its width. You might go even a percent smaller, to avoid bleeding due to rounding errors in the rendering math. Unfortunately, this reduces the portion of the texture that's actually displayed by half.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

8 minutes ago, shymus Roffo said:

This would give that padding that Klytyna would be referring too

Basically, you want the width and height of the texture, to be slightly greater than the diagonal corner to corner distance on the plane, with in that the circular design can be done so as to almost touch the sids of the plane when the texture is rotated 45 degrees...

So you can in fact use more of your texture for the compass rose than you have...

size the rose to fit inside a diagonal square inside the square texture...
 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1070 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...