I haz created a more or less traditional book in OpenSim using LSL scripting.
It runs in a single cube prim. For your own copy of my first effort, paste this into a script and drop it in a cube prim:
vector opensize=<0.064,0.5,0.35>;
vector closedsize=<0.04,0.265,0.35>;
string book="closed"; // b6258725-335d-4e47-9676-39361010f5cc 34270b40-68a2-4341-aeb3-10e3b2f45214
list pageUUIDs=["ce3f600b-0028-40f0-a77b-10426b8ff975","07a9e95b-ef73-47ef-80f1-b6c168529142","e39d7c07-aa29-4776-8083-b6a055427995","589e5863-b3a5-4441-a2c8-fd960cf1997e","32ae5dd8-582c-410a-afc9-fef75fc4a6b4","4152fba5-02ef-4f1a-a7d2-9d4ebc4a8be1","f4427be8-651d-47d5-ab06-5597443b92d2","aeb9162e-a2e3-4942-ba58-1ed0cbb250ab","98888e86-b1d4-412f-b275-a98d04038dad","1840ea8f-ba8e-47b0-8182-cf3abc56bb8d","a00dd649-f617-4f39-a4e0-6b110199d439","a063425d-b31a-4309-8d4d-1886f1cd8530","afb3f53e-9ca6-425e-874a-f9bba796d7cf","09c65ace-d015-4a6c-9467-421f9f728f42","bb976ea4-f423-4706-b7f8-33fd4d856029","8b7f7d9e-57f2-4c17-a010-30972be1982c","707e44d8-e432-47f7-9535-b42e032f485f","f860fb9b-d1fb-486c-948f-7131bade9662","b065b77a-6e6c-4cfd-9079-50df43455595","006e3243-9817-49e2-b975-1c1c8e5b5222","2e86574c-21a1-46ef-a6cb-e076c6e94d27","f4df80e8-2e47-4287-abc8-9422d299995c","5470da29-83f5-4cab-8ee1-c0cd80102450","19ef268b-03e5-4678-aff8-d7db5d3b1ccf","fef6f8ed-554f-44e5-88ec-93338196981b","b61d1655-044f-4332-aa1b-558b042f2ea1","dbdeb221-5eb7-461e-acd1-a57b0e733c4f", "bf5b0c57-2d57-4bb4-82f3-a22ce8e9a1ac", "ccee6b1d-7201-43c1-bf31-e664a6f4c808",
"b6258725-335d-4e47-9676-39361010f5cc", // right here gets a repeat
"34270b40-68a2-4341-aeb3-10e3b2f45214","209f134d-32ef-49cf-8760-478f2e356534","d0353b58-7513-4180-90f2-5b0cba0fda5d","3f61aaa4-3168-4605-bcd3-41a12f0cae69","1d4072de-b47d-43f9-acf6-2bd33a081313","a6bcd0c1-af54-4639-8e44-804038b30c73","96989e63-3697-4952-9921-7f950122c962","13ac21e6-54a9-41be-9bb3-42dee4cbad8d","9378acb0-187a-48c9-94b3-dc3fad2e02d1","6992ee7b-b1c9-4685-9437-742ad33b066b","51061eb8-a8e3-48c1-b969-83cda8496250","e7a86214-23f5-4840-8eb2-fae38dcd0ddf","9a993a2c-c6f2-430c-95de-10367879cf1e",
"b3bd7ec4-ad57-427f-9d9f-dc1457a30d1b","d5d5d201-dbad-4540-9559-a75c768b0e75","ec60869c-df31-43fe-a80f-400f49b3f3d8","2f180734-558a-4e8d-9131-317f93f9019c","fab8d130-6d23-4c25-bd7e-abf0c2c9674f","e91a5db7-ad57-4766-9bcd-1b54f39bfb78","c5a0438c-e86c-4e8c-a461-a14570e36242","4092de87-0b38-4fe1-be51-ab258bfe01cd","1251b2ca-0602-4a57-a5d2-5e19898bdbc7","c0f03827-7112-4124-af64-37f5dc624c4b","d01de6ae-f48c-4781-884e-d8ffd7c9ff15","044038a3-e2ce-42f7-bead-2ac491e1e7fd","9d355fe2-4e47-473c-b197-c14096d04fb1","047295f3-2fbe-4bc0-a20a-0c4ee45e9c0c","f31329b3-5a86-4bbd-a354-946047293896","b3b8e143-596c-4dcc-b343-a1d6e2259ace","f89e5cfc-34f8-496a-8502-797878860b73","5512e24a-7ba1-4c60-8b0e-82be455d0314","2881aad1-f9ae-4145-9eb7-9cfaab604f26","b8892fb5-df34-448c-9528-f807b6d0c6cd","876a6985-c37a-4510-b940-cd185621f4ff","611fdde9-6abd-4d48-b4e8-aeda55414258","a46dade4-5efd-4f5a-afb0-e44324606405","bb89eebb-9e8b-4718-8fee-d0676a77839d","87955458-f05b-445d-8721-b359fcb1a279","ece2b053-0245-4b08-bc6f-22755823f968","7101e397-4f8b-43ff-80fb-2ea6eb792373","55fd7df3-06c7-4c92-9701-a511f3838317","80b13e0f-8f66-495c-9af1-086606e052fb","3435ed56-7e8a-4b8b-abf2-58011ff91b15"];
integer pagesets=72;
integer pageset=0;
settexture()
{
string ID=llList2String(pageUUIDs,pageset);
key textureID=(key) ID;
llSetTexture("041d02c0-b2fa-4ddf-bafb-c438adf72fc4",0);
llSetTexture("041d02c0-b2fa-4ddf-bafb-c438adf72fc4",1);
llSetTexture("041d02c0-b2fa-4ddf-bafb-c438adf72fc4",3);
llSetTexture("041d02c0-b2fa-4ddf-bafb-c438adf72fc4",4);
llSetTexture("63f5294b-6a33-4219-97cc-d3965b7106fb",2);
llSetPrimitiveParams([PRIM_TEXTURE, 5, textureID, <0.5,1,0>, <0.25,0,0>, 0.0]);
llSetPrimitiveParams([PRIM_TEXTURE, 6, textureID, <0.5,1,0>, <-0.25,0,0>, 0.0]);
// llSetTexture(textureID,5);
// llSetTexture(textureID,6);
llSetTexture("041d02c0-b2fa-4ddf-bafb-c438adf72fc4",7);
}
closebook()
{
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, 0, <0,1,0>, 0.0, <0,0,0>, <1,1,1>, <0,0,0>]);
llSetPrimitiveParams([PRIM_SIZE, closedsize]);
llSetTexture("041d02c0-b2fa-4ddf-bafb-c438adf72fc4",5);
llSetTexture("041d02c0-b2fa-4ddf-bafb-c438adf72fc4",0);
llSetTexture("041d02c0-b2fa-4ddf-bafb-c438adf72fc4",1);
llSetTexture("63f5294b-6a33-4219-97cc-d3965b7106fb",3);
llSetTexture("63f5294b-6a33-4219-97cc-d3965b7106fb",2);
llSetTexture("63f5294b-6a33-4219-97cc-d3965b7106fb",4);
}
default
{
state_entry()
{
closebook();
book="closed";
pageset=0;
}
touch_start(integer num_times)
{
if(book=="closed")
{
book="open";
llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, 0, <0,0.725,0>, 0.0, <0,0,0>, <1,1,1>, <0,0,0>]);
llSetPrimitiveParams([PRIM_SIZE, opensize]);
settexture();
} else if(book=="open")
{
pageset=pageset + 1;
if(pageset>(pagesets-1))
{
closebook();
book="closed";
pageset=0;
} else {
settexture();
}
}
}
}
See if you can figure out why it repeats the 31st pageset, I cant - it may be a bug in OpenSim.
Oh, and a bit of an easter egg for those of you running linux that read this far:
get a debian pkg of qavimator binaries here:
http://www.byteme.org.uk/qavimator.html
Cheers!
Friday, August 15, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment