This is G o o g l e's cache of http://www.flashsandy.org/forum/index.php?act=Print&client=printer&f=17&t=116 as retrieved on 31 Jul 2007 18:46:52 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:NMN-k7X8LQUJ:www.flashsandy.org/forum/index.php%3Fact%3DPrint%26client%3Dprinter%26f%3D17%26t%3D116+act%3DPrint+%22index+php%22+-lofiversion+site:www.flashsandy.org&hl=en&ct=clnk&cd=74


Google is neither affiliated with the authors of this page nor responsible for its content.
These terms only appear in links pointing to this page: act print index php

Printable Version of Topic

Click here to view this topic in its original format

Sandy's Forum _ AS2 1.x versions _ 3DCurvedLine??

Posted by: link Aug 23 2006, 06:16 PM

how can i draw a curved line??

Posted by: kiroukou Aug 23 2006, 06:20 PM

Hello,
You have to create a primitiv object like Line3D and use the correct face object.

Bye

Posted by: link Aug 23 2006, 06:23 PM

i kwon is some like the primitive class Line3D
but i need to use the CurvedEdge3D i think so

Posted by: kiroukou Aug 23 2006, 06:24 PM

You should look at the Line3D class, and creaet your CurvedLine3D or whatever.

Should be pretty easy to do.
++

Posted by: link Aug 23 2006, 06:28 PM

CODE

/*
# ***** BEGIN LICENSE BLOCK *****
Copyright the original author or authors.
Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
    http://www.mozilla.org/MPL/MPL-1.1.html
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

# ***** END LICENSE BLOCK *****
*/

import sandy.core.data.Vector;
import sandy.core.data.Vertex;
import sandy.core.Object3D;
import sandy.core.face.Edge3D;
import sandy.primitive.Primitive3D;
import sandy.skin.SimpleLineSkin;
import sandy.core.face.CurvedEdge3D


class sandy.primitive.CurvedLine3D extends Object3D implements Primitive3D
{

    
    public function CurvedLine3D ( a:Vector, b:Vector, c:Vector)
    {
        super ();
        if( arguments.length < 3 )
        {
            trace('CurvedLine3D::Number of arguments to low');
        }
        else
        {
            for( var i:Number = 0; i < arguments.length; i++ )
            {
                aPoints.push ( new Vertex( arguments[i].x, - arguments[i].y, arguments[i].z ) );
            }
            generate ();
        }
    }
    
    /**
    * generate
    *
    * <p>Generate CurvedLine3D : </p>
    */
    public function generate ( Void ) : Void
    {
        // initialisation
        _aFaces = [];
        var l:Number = aPoints.length;
        for( var i:Number = 0; i < l-1; i++ )
        {
            addFace( new CurvedEdge3D( this,aPoints[i], aPoints[i+1], aPoints[i+2] ) );
        }
    }
    
    /**
    * Set a Skin to the CurvedLine3D.
    * <p>This method will set the a new skin to the line, but the skin must be a SimpleLineSkin instance.</p>
    * @param    SimpleLineSkin s    The new SimpleLineSkin skin
    * @param    bOverWrite    Boolean, overwrite or not all specific Faces's Skin
    * @return    Boolean True to apply the skin to the non default faces skins , false otherwise (default).
    */
    public function setSkin( s:SimpleLineSkin, bOverWrite:Boolean ):Boolean
    {
        bOverWrite = (bOverWrite == undefined ) ? false : bOverWrite;
        super.setSkin( s, bOverWrite );
        return true;
    }
    
}


what do you think?

Posted by: kiroukou Aug 23 2006, 06:32 PM

seems ok except:
for( var i:Number = 0; i < l-1; i++ )
that should be :
for( var i:Number = 0; i < l-2; i++ )

is it working?

Posted by: link Aug 23 2006, 06:36 PM

yup it's working =)
let me try
for( var i:Number = 0; i < l-2; i++ )

for( var i:Number = 0; i < l-2; i++ )

works fine too =)

thanks !

Posted by: kiroukou Aug 23 2006, 06:36 PM

great !

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)