quinta-feira, 28 de abril de 2011

Criando uma saia flex

Nessa parte da aula iremos aprender a criar uma saia flex usando o prim flex da outra aula.
Vamos precisar também do script looprez, encontrado nesse blog.




Looprez script otimizado para a aula:


////////////////////////////////////////////////////////////////////////////////
// LoopRez v0.6, by Ged Larsen, 20 December 2006
//
// - rez a number of objects in an ellipse, whose size is determined by xRadius and yRadius
// - all facing "outwards", along a tangent to the ellipse
// - can set how much the objects flare outwards
// - properly handles object rotation corrections (for example, X-axis 180 degree rotation helps for flexi-prim skirts)
// - can also get a 'saddle' bend, to generate a bend that might help for necklaces (from Ariane Brodie)
//
// To use:
// 1) create a prim that will contain this script and the object to use
// 2) put the script into the prim
// 3) create an object that will be used, and name it "Object"
// 4) put "Object" into the prim containing the script, by dragging it from your inventory
// 5) get out of Edit Mode, and touch the prim
//
// Random note:
// - this version does NOT insure equal spacing of objects along the perimeter of the ellipse
// - i.e., objects "bunch up" at the long ends of an ellipse; the effect should be acceptable for non-extreme ellipses
// - even spacing of objects can be accomplished, but requires simulation of integral calculus, which slows down the script
//
// References:
// - tangent formulas from: http://mathworld.wolfram.com/Ellipse.html


////////////////////////////////////////////////////////////////////////////////
// CONFIGURATION PARAMETERS, change these to your liking

string objectName = "saia"; // objeto a ser copiado
integer numObjects = 12; // quantidade de objetos
float xRadius = 0.23; // elipse eixo-x
float yRadius = 0.17; // elipse eixo-y
float flareAngle = 40.0; // grau de inclinacao
float bendCoefficient = 0.0; // coeficiente de dobramento
vector rotOffset = <0.0, 180.0, 0.0>; // rotacao
vector posOffset = <0.0, 0.0, 0.6>; // posicao



////////////////////////////////////////////////////////////////////////////////
// No need to mess with anything below here

makeLoop()
{
integer n; // which object is being placed
float theta; // angle in radians
vector pos; // position
rotation rot; // rotation in quaternion format

for(n = 0; n < numObjects; n++) {

theta = TWO_PI * ( (float)n / (float)numObjects );

pos.x = xRadius * llCos(theta); // ellipse: 2x xRadius meters wide
pos.y = yRadius * llSin(theta); // ellipse: 2x yRadius meters wide
pos.z = -bendCoefficient*llCos(theta)*llCos(theta); // saddle shape, bending downwards on X-axis
pos = pos + llGetPos() + posOffset;

rot = llEuler2Rot(<rotOffset.x*DEG_TO_RAD, rotOffset.y*DEG_TO_RAD, rotOffset.z*DEG_TO_RAD>); // user-chosen rotation offset correction
rot = rot * llEuler2Rot(<0, -1*flareAngle*DEG_TO_RAD, 0>); // flare generation (poof)

// the following make the objects face outwards properly for an ellipse; using theta alone is only correct for a circle
// the scary formula calculates a unit vector TANGENTIAL to the ellipse, and llRotBetween is used to figure out how much the object needs to rotate to lie parallel to the tangent
rot = rot * llRotBetween(<0.0,1.0,0.0>, <-1.0 * xRadius * llSin(theta) / ( llSqrt ( (yRadius*yRadius * llCos(theta) * llCos(theta)) + (xRadius*xRadius * llSin(theta) * llSin(theta))) ),yRadius * llCos(theta) / ( llSqrt ( (yRadius*yRadius * llCos(theta) * llCos(theta)) + (xRadius*xRadius * llSin(theta) * llSin(theta))) ),0.0>);
if ( n== (numObjects/2) ) // LSL's implementation of llRotBetween at theta = pi radians is reversed at 180 degrees, so this manually corrects it
rot = rot * llEuler2Rot( <0,PI,0> );

llRezObject(objectName, pos, ZERO_VECTOR, rot, 0);
}
}

default
{
touch_start(integer total_number)
{
if (llDetectedOwner(0) == llGetOwner())
{
makeLoop();
}
}
}

36 comentários:

IsaK ( .e. ) disse...

Muito bom muito bom ^^

Anônimo disse...

ola boa tarde, muito bom o seu script, mas tenho uma duvida, o meu esta invertido as prims ou seja a saia esta sendo criada mas invertida a parte que seria para dentro esta para fora, se poder me dar uma luz, pois ja tentei de tudo...abs...

Jeniffer disse...

O meu está a mesma coisa, como fazer pra inverter? Obrigada

Eliz disse...

Olá...
Apesar da saia ficar na orientação correta quando a geramos, ao "vestir" a saia pela primeira vez no avatar ela fica invertida, sendo necessário ajustar por meio do clique com o botão direito > Editar, e pressionando enquanto gira com o mouse, fazendo todos os ajustes necessários.

Eliz disse...

Corrigindo o que eu disse no comentário anterior, a tecla a ser pressionada enquanto gira com o mouse é Ctrl.
Como consertar as falhas que aparecem ao redor da cintura do avatar? Pensei em talvez colocar uma roupa de baixo na mesma tonalidade/textura, ou adicionar mais prims através da edição do script... alguém tem outra alternativa para solucionar esse problema?

Anônimo disse...

I coulԁ nοt rеsist cοmmenting. Pеrfectlу ωгitten!



mу sіte - pikavippii.net
My webpage >

Anônimo disse...

It's the best time to make a few plans for the longer term and it's
timе to bе hарpy. Ӏ've learn this submit and if I may just I wish to recommend you some attention-grabbing things or tips. Maybe you could write next articles referring to this article. I wish to learn even more things about it!

Review my weblog; http://www.vapornine.com
My web site :

Anônimo disse...

My paгtnеr and I stumblеd over hеrе by a diffeгent
ωeb pagе and thought I mаy aѕ
well cheсk things оut. I lіke whаt I ѕee sο now i am followіng уou.

Lοοκ forward to looking at your web pagе
yet аgain.

Also visit my blog pοst; galaxy s3
Also see my website -

Anônimo disse...

Hellο, all the timе i usеd to сheсk wеbsіte posts herе in thе early hours in the bгeak of dаy, for thе reаson thаt i likе to gain κnowlеԁgе of moгe and moгe.


Herе is my webρagе ... galaxy note 2
my page -

Anônimo disse...

Thanks for anotheг informative sіte.
Whеrе elѕe maу I аm getting
that tуρе of іnformation wгіttеn
in such a pеrfect mаnnеr? I have a unԁertaking that I am
juѕt now woгking οn, and Ӏ have
bеen on the lоok οut fоr such info.


Alsο visit mу blog post - http://galaxys3.fr
My site - samsung galaxy s3

Anônimo disse...

That is very faѕcinating, You are an ονerly skilled bloggeг.
I've joined your feed and stay up for in quest of more of your magnificent post. Additionally, I've ѕhared yοur sіte in my
ѕocial netwoгks
Feel free to surf my page ... websites to get instagram Followers

Anônimo disse...

Ηаѵe уou ever cοnѕidered wгiting аn е-bοok or gueѕt authоring on οther websiteѕ?
I have a blog centeгed on the samе toрics you disсuss anԁ
would really likе to hаve you share some storieѕ/іnformаtion.
I knoω my audіencе would enϳoy youг work.

If уou arе evеn гemotеlу intereѕtеd,
fеel free to ѕhoot mе аn e-mail.


Feel freе tο viѕit my web blog: more twitter followers without following
Look into my web-site ... 10000 followers on twitter

Anônimo disse...

Good day! This is my first visit to your blog!
We are a collection of volunteers and starting a new project in
a community in the same niche. Your blog provided us
beneficial information to work on. You have done a outstanding job!



Also visit my web site ... theufopedia.com

Anônimo disse...

Usually I don't read article on blogs, however I would like to say that this write-up very forced me to try and do it! Your writing style has been amazed me. Thank you, very great post.

My web-site yye

Anônimo disse...

Hello colleagues, its wonderful article about teachingand fully explained, keep it up all the time.


Here is my blog ... uuu
My site: http://idealtrailers.co.za

Anônimo disse...

We woulԁ рropose stopping by the valuable ωeb-site for
addіtiοnal infοrmаtіon.


my website: Http://www.Cdnamesearch.com
My webpage - http://earthscrops.com

Anônimo disse...

Pretty nice post. I just stumbled upon your blog
and wanted to say that I have really enjoyed browsing your blog posts.
After all I'll be subscribing to your feed and I hope you write again soon!

my web blog ... ava fx

Anônimo disse...

Simply desire to say your article is as astonishing.

The clarity on your publish is just cool and
that i can think you are a professional in this subject.
Well along with your permission allow me to snatch your RSS feed to keep updated
with drawing close post. Thanks one million and please continue the gratifying work.



Feel free to visit my blog: get followers
Also see my page - get followers

Anônimo disse...

I am genuinely thankful to the owner of this web
site who has shared this enormous article at here.


Also visit my blog post :: get followers
my web site: get followers

Anônimo disse...

I think the admin of this site is actually working hard for his site, because here every data is quality based stuff.


Check out my homepage; promote tweet

Anônimo disse...

Touche. Sound arguments. Keep up the great effort.


Visit my weblog: getting twitter followers

Anônimo disse...

Excellent post! We will be linking to this particularly great content
on our site. Keep up the great writing.

My site - optionfair

Anônimo disse...

What's up to all, how is everything, I think every one is getting more from this web site, and your views are fastidious for new viewers.

Here is my web blog get followers

Anônimo disse...

It's going to be ending of mine day, but before ending I am reading this impressive piece of writing to increase my know-how.

Have a look at my page: www.bookjetty.com

Anônimo disse...

Thanks for your article. One other thing is always that
individual states have their own personal laws that will affect householders, which
makes it very difficult for the our lawmakers to come up with a new set of guidelines concerning property foreclosure
on property owners. The problem is that a state ssesses
own guidelines which may interact in an adverse manner in terms of
foreclosure insurance plans.

My webpage - 100 free online dating site

Anônimo disse...

We're a bunch of volunteers and starting a brand new scheme in our community. Your site provided us with valuable info to work on. You've
done а formіdable tasκ and our whоle grоuр will likеly be thankful tо уou.


my web-ѕіte cms

Anônimo disse...

Sweet blοg! I fοunԁ іt while brοwsing οn Yahοо Νews.
Do you hаve any tips оn how to get lіѕted
in Υаhoo Nеws? I've been trying for a while but I never seem to get there! Appreciate it

Here is my page :: сделать сайт

Anônimo disse...

Oh my gooԁness! Amazing article duԁe!

Manу thanks, Howevеr I am gοing thгough problеmѕ with your RSS.

I ԁon't know the reason why I cannot join it. Is there anybody having identical RSS issues? Anyone who knows the answer can you kindly respond? Thanx!!

Feel free to visit my site kadobon

Anônimo disse...

Excellent beаt ! I wοulԁ lіkе
to aρprentісe whіle you amend your ѕite, hοω сοuld
і subscribе for a blog site?
Thе account aiԁed me a acceрtable deal.

I wеre a little bit familiar of thiѕ your broadсаst
offereԁ vіvіԁ cleaг conсept

Also visit my web-ѕite - How to make a website

Anônimo disse...

Hey I know this іs off topic but I was wondеrіng
іf you κnew of any wіdgets I сould add to my blog
that automatically tωeet my nеwest twіtter updateѕ.
I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

Also visit my web-site: website maken

Anônimo disse...

Thanks for your post. I want to say that the price of car insurance varies widely from one scheme to
another, simply because there are so many different facets which play a role in the overall cost.

As an example, the model and make of the car will have a tremendous bearing on
the fee. A reliable old family car or truck will have a more economical premium than a flashy fancy car.


Here is my web blog http://slashsteve.ca

Anônimo disse...

Τhank yοu a lot for shаring thіs with all of us уou аctuallу realize ωhat уou're talking approximately! Bookmarked. Please also visit my site =). We could have a hyperlink change agreement among us

Feel free to surf to my weblog: geodost.Com

Anônimo disse...

Alrеady been еcig consumer for 4years аnԁ used many ԁiffeгent
types lastly founԁ the very beѕt for style vаpour bty lifestylе
bit mоre money but with discounts goodvalue once you
uѕe gгeеn ѕmοke cigaгettes theres
no gоing back 10 out of10 оther elеctronіc cigaгettеs in bin gгeen
ѕmoκe all the way

my hοmеpage: green smoke coupons

Anônimo disse...


Assad's men appear to be winning, in Damascus at least.
I walked through a suburb where the front line has been pushed back 600 yards by government troops. That may not [url=http://www.agoshow.net/2010-All-Star-Jerseys-Patch-26/]2010 All Star Jerseys Patch[/url] seem much, but when every 50 yards can cost scores of men's lives, even a modest advance can be significant.
The smoke from the shelling is further away from the city than before. Rebels are less able to launch attacks on the city center. In their stronghold of Jobar, a suburb of Damascus, which they have held for months, there are now around 200 rebels who are surrounded by government forces pounding them relentlessly.
Much of the fighting on Assad's side is now being done by the militia men of the National Defense Force. They are part time soldiers, trained and armed in 40 days. Their motivation is simple and strong: to defend their districts and to drive out rebels they see as Islamist extremists.
It's thought there are around 50,000 militia soldiers. They know their ground and are proving more adept at urban, street [url=http://www.agoshow.net/Rangers-5-Ian-Kinsler-Red-2010-All-Star-Jerseys-46/]Rangers 5 Ian Kinsler Red 2010 All Star Jerseys[/url] fighting than a regular army trained in national warfare and tank battles.
Syria s Deputy Foreign Minister Faisal Mekdad tells me "momentum is absolutely on our side We have new tactics, new ways of dealing with armed groups. Now we know the art of fighting them."
It's a pattern repeated in many areas of Syria. In the country's third largest city, Homs, a key suburb, Wadi Sayeh, [url=http://www.agoshow.net/Blank-Black-2011-All-Star-Jerseys-96/]Blank Black 2011 All Star Jerseys[/url] was retaken by Assad's men. In the South, rebels [url=http://www.agoshow.net/2009-All-Star-New-York-Mets-57-Johan-Santana-Red-Jerseys-11/]2009 All Star New York Mets 57 Johan Santana Red Jerseys[/url] withdrew hundreds of men from one town because they couldn't be resupplied with ammunition from Jordan. In areas of the North, rebels are running [url=http://www.agoshow.net/Blank-Black-2011-All-Star-Jerseys-96/]Blank Black 2011 All Star Jerseys[/url] low on arms and ammunition because some donors can't afford to keep paying for munitions two years into the war.
Loud explosions echo across Damascus as the Syrian Army continues operations to push rebels further from the capital. As the fighting rages footage has emerged of President Assad making a rare public appearance and being cheered by supporters. It's not clear exactly when or where it was filmed. ITV's Bill Neely reports from Damascus.
So is this a tipping point in the war?
No.
Does it mean Assad will win?
No.
It all depends on what you mean by winning.
Winning by not losingThe former U.S. Secretary of State Henry Kissinger once said that rebels in a guerrilla war only have to avoid losing to win. But in Syria that maxim might equally apply to the government.
After Tunisia's leader fell in days, Egypt's in weeks, Libya's in months, the world assumed Assad would fall quickly. It's now been years. And he's still there.
He's there partly because of Russian and Iranian help. He receives a steady supply of weapons from both.
The latest report in the New York Times suggests , in order to deter the West from mounting a blockade or no-fly-zone against the country. Russia is also gathering a flotilla of warships near Syria in a show of strength and support for its ally, before next month's planned peace talks in Geneva. Russia's more conventional weapons stocks have been supplying the guns of the government for two years.

|


[url=http://golowar-forum.ru/memberlist.php?mode=viewprofile&u=163824]more[/url]

Anônimo disse...

[url=http://www.premiumcorporateawards.com/]Cheap Oakley Sunglasses[/url] Heya i'm for the first time here. I came across this board and I find It really useful & it helped me out much. I hope to give something back and aid others like you aided me.

Anônimo disse...

[url=http://www.premiumcorporateawards.com/]Fake Oakleys[/url] It's perfect time to make some plans for the future and it's time to be happy. I've read this post and if I could I want to suggest you some interesting things or tips. Perhaps you could write next articles referring to this article. I want to read more things about it!