Jump to content

PRIM_TEXTURE face number! is this possible?


Cindy Kraai
 Share

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

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

Recommended Posts

I'm not sure if this is possible or allowed in lsl but can we do something like this?

llSetLinkPrimitiveParamsFast(LINK_THIS,[
PRIM_TEXTURE, 0, texture, <1.0, 1.0, 0.0>, <0.0, 0.5, 0.0>, 0.0,
PRIM_TEXTURE, side number 1 to 3, texture, <1.0, 1.0, 0.0>, <0.0, 1.656, 0.0>, 0.0,  
PRIM_TEXTURE, side number 4 to 6, texture, <1.0, 1.0, 0.0>, <0.0, 1.0, 0.0>, 0.0
]);

instead of uploading multiple textures i decided to just rotate them accordingly in their faces but is it possible to do something like "side number 1 to 3 is <0.0, 0.5, 0.0>" and "side number 4 to 6 is <0.0, 1.5, 0.0>". Please help, and thanks for giving some samples :) 

Link to comment
Share on other sites

There's a constant, ALL_SIDES, that can set the texture parameters for all the sides at the same time, and then you can follow up with more PRIM_TEXTURE parameters in the same call to llSetLinkPrimitiveParamsFast().

All the parameter settings in a single call (usually?) take place in the same simulation frame (although possibly generating separate update messages), so it's as if they were all done simultaneously.

Link to comment
Share on other sites

Instead of typing the same information many times, you could define a temporary set of variables:

Stuff_1 = [texture, <1.0, 1.0, 0.0>, <0.0, 0.5, 0.0>, 0.0];
Stuff_2 = [texture, <1.0, 1.0, 0.0>, <0.0, 1.656, 0.0>, 0.0];
Stuff_3 = [texture, <1.0, 1.0, 0.0>, <0.0, 1.0, 0.0>, 0.0];

and then write

llSetLinkPrimitiveParamsFast(LINK_THIS,[
PRIM_TEXTURE, 0]+Stuff_1 + [PRIM_TEXTURE, 1] + Stuff_2 + [PRIM_TEXTURE, 2] + Stuff_2 + [PRIM_TEXTURE,3] + Stuff_2 +  
[PRIM_TEXTURE, 4] + Stuff_2 + 
and so on ...
  • Like 1
Link to comment
Share on other sites

Thanks guys these really helps, thanks Rolig Loon for the example. My follow up question is, 

llSetLinkPrimitiveParamsFast(LINK_THIS,[
PRIM_TEXTURE, 0, texture, <1.0, 1.0, 0.0>, <0.0, 0.5, 0.0>, 0.0,
PRIM_TEXTURE, 1||2||3, texture, <1.0, 1.0, 0.0>, <0.0, 1.656, 0.0>, 0.0,  
PRIM_TEXTURE, 4||5||6, texture, <1.0, 1.0, 0.0>, <0.0, 1.0, 0.0>, 0.0
]);

you can't do it this way right? i was hoping it is possible. It saves correctly but doesn't work at all

Link to comment
Share on other sites

1 hour ago, Cindy Kraai said:

you can't do it this way right? i was hoping it is possible. It saves correctly but doesn't work at all

No, you can't do that.  It may compile correctly because everything after the LINK_THIS argument is considered as a list, but it will never execute properly because the list element that contains the face number is meant to be an integer, not a conditional statement.

Link to comment
Share on other sites

4 hours ago, Cindy Kraai said:

Thanks guys these really helps, thanks Rolig Loon for the example. My follow up question is, 


llSetLinkPrimitiveParamsFast(LINK_THIS,[
PRIM_TEXTURE, 0, texture, <1.0, 1.0, 0.0>, <0.0, 0.5, 0.0>, 0.0,
PRIM_TEXTURE, 1||2||3, texture, <1.0, 1.0, 0.0>, <0.0, 1.656, 0.0>, 0.0,  
PRIM_TEXTURE, 4||5||6, texture, <1.0, 1.0, 0.0>, <0.0, 1.0, 0.0>, 0.0
]);

you can't do it this way right? i was hoping it is possible. It saves correctly but doesn't work at all

It saves correctly because "1||2||3" and "4||5||6" both become 1, which is a totally valid face number even if it's not the one you intended.

The function itself expects a list of single values. There's no way to denote a range of numbers in LSL.

Link to comment
Share on other sites

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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...