Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

BIG circles!

Taun Patel
Geothermal Madman
Join date: 5 Mar 2004
Posts: 222
10-06-2004 06:20
Okay, so math and I sorta had a throw down last night and well ... math won. I did some searching for how to figure out the diameter of a circle given its circumference, got that but the angle I needed to rotate at elludes me. So, here's the problem.

A friend in the Real World asked me to help him design a house using Second Life. This is no ordinary house as it's round, and uses panels of 10' x 6' to create a circle. Given the number of panels and their width, how can I make this blasted circle? The best thing would be to have a script do the creating (Neo? Are you there? :-)) so I can give it the params in chat like this:

You: circle feet_or_meters panel_width panel_height panel_depth number_of_panels

Another thing I'll need is a floor :-) ooh and a roof (cone-shaped)... so if you can add that into the program mad props to you! I don't exactly need a whole script, if someone can point me in the right direction and answer my questions that would really be great!

So here's what I'm looking for ... formulae to find the rotation angle where I know the approximate arc length (panel_width) and circumference of said circle (panel_width * number_of_panels). Then I need to create a floor (pie wedges, I know, but I always eyeball it and that doesn't seem to be the way to go on this one). Finally I need a pitched roof that uses the pie wedges but rotates them about their local y axis by x number of degrees.

Your help is greatly appreciated :D
Taun Patel
Geothermal Madman
Join date: 5 Mar 2004
Posts: 222
10-06-2004 07:45
Never to be one to just expect answers to llRezObject themselves (yuk yuk), here's what I'm thinking I'll do to get it to work once I have some formulae that a non-math guy can handle!

I've created a rezzing object that has a default .5^3 cube sitting inside it. The plan is to get said rezzing object (Rezzer) to rez the cube (Cube) and have Cube send a message back to Rezzer saying what it's UUID is so that Rezzer can tell Cube to set it's height width and length, and ultimately link Cube to other Cubes and create the cylinder :-)

I think that made sense anyway :-D

I'm figuring out the llRezObject now, so far I can get it to pop a cube over itself, just need to add the appropriate rotation and such :) Yay for the Wiki!
Taun Patel
Geothermal Madman
Join date: 5 Mar 2004
Posts: 222
10-06-2004 07:57
Haha ... I think I have an answer for myself! .. okay .. just hear me out on this :)

Rezzer rezzes 14 Cubes and rotates them to the rotation you'd need for each arc. Rezzer then says to the Cubes on a private channel the parameters they need for llSetPrimitiveParams and the Cubes (having a listen script that takes that info and sets their params based on it) set their own parameters to make the wall size.

so you end up with an asterisk looking thing where they all intersect.

then it just flngs each panel outward for the radius length along the panel's x axis and viola! Cylinder!
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
10-06-2004 08:22
yep that will work. Just be sure to release the listen after you send the command or you will end up with all the sections moving (disaster if you use the same channel).

Be sure to keep the text you send over chat is 255 characters or less or your script will crash (chat limit). Emails have a larger size limit as do linked messages (for my rezzer i link on the new prims send them a linked message then unlink them).

When you initialize the listen in the object be sure to store it to a global integer so you can release it. This way it only listens to one command.

example:
CODE

integer listenHandle

default
{
state_entry()
{
listenHandle=llListen(54,"","","");
//your code here
}
listen(integer a, string b, key c, string d)
{
llListenRemove(listenHandle);
//your code here
}
}
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Taun Patel
Geothermal Madman
Join date: 5 Mar 2004
Posts: 222
10-06-2004 08:26
Thanks Strife! I'm going to have the Rezzer rez x number of Cubes at the same time, rotating them each to the specified rotation. Then, it'll say the command once to all the cubes and they'll all rotate, fling themselves outward and then kill their listens so evil doers cant tell my walls to move around !!!