The conversation was called

Discoball - Lightning vs. environment shading

Maybe something in there will help answer your question? If not, it sounds a
bit hairy, and not just "right out the box", so good luck!

-Pete


On Wed, Aug 19, 2009 at 10:31 AM, Peter Kapelyan <[email protected]>wrote:

> The guy that made this site (with Away3D) was asking how to go about making
> it on this list (and I think Fabrice was helping him out with this part
> also)...
>
> Try searching this group for "disco". Also, hopefully, he'll pop up his
> head and shed some light on your question.
>
> -Pete
>
>
> On Wed, Aug 19, 2009 at 10:28 AM, richardolsson <[email protected]>wrote:
>
>>
>> Sorry, but I can't enter the site. It loads to 100% and then, nothing.
>>
>> If what you want is to put planes on the surface of a sphere, all you
>> need is some nice trigonometry. Lets call every row of planes a
>> "circle" and every plane in a circle a "sector". Here is some pseudo
>> code:
>>
>> RADIUS = 100
>> CIRCLES = 10
>> SECTORS = 20
>>
>> // Angle between two circles,
>> // and two sectors respectively
>> circ_dv = PI / CIRCLES
>> sect_dv = PI * 2 / SECTORS
>>
>>
>> for (c = 0; c < CIRCLES c++)
>>  // angle from center for this circle
>>  circ_v = c * circ_dv
>>
>>  // radius for this circle
>>  // (smaller towards top/bottom)
>>  xz_rad = RADIUS * sin(circ_v)
>>
>>  for (s = 0; s < SECTORS s++)
>>    // angle for this sector
>>    sec_v = sec_dv * s
>>
>>    // create a plane using some
>>    // mythical method
>>    plane = myCreatePlaneFunction()
>>
>>    // trigonometry to position plane
>>    // correctly on all axes
>>    plane.x = xz_rad * cos(sec_v)
>>    plane.y = RADIUS * Math.cos(circ_v)
>>    plane.z = xz_rad * sin(sec_v)
>>
>>
>>
>>
>> If you want all the planes to be rotated correctly, you can also use
>> lookAt() to point them towards the center and then flip them, or you
>> can calculate their angles in the same fashion as their positions:
>>
>> plane.rotationY = 90 - (sec_v * 180/PI)
>> plane.rotationX = 90 + (circ_v * 180/PI)
>>
>> The offsets (+/- 90) might not work for the coordinate system you're
>> using. I just grabbed these out of a project where I'm using the
>> native Flash 10 system, which is not the same as the one in Away3D (y
>> axis points in different directions.) I'm way too tired in my head to
>> figure it out now, so you're gonna have to work some trial and error
>> magic on those numbers. :)
>>
>>
>>
>> Good luck!
>>
>> /R
>>
>> On Aug 19, 1:56 pm, Wenderson <[email protected]> wrote:
>> > Oh, sorry I actually forgot to put the link (rererere), the link is
>> > this one:  http://www.the951.com/
>>
>
>
>
> --
> ___________________
>
> Actionscript 3.0 Flash 3D Graphics Engine
>
> HTTP://AWAY3D.COM
>



-- 
___________________

Actionscript 3.0 Flash 3D Graphics Engine

HTTP://AWAY3D.COM

Reply via email to