Some BezierPatch questions.

Software: Away3D 3.x

vegetable, Newbie
Posted: 12 January 2012 03:21 PM   Total Posts: 7

Hello.
I need to transform image with user defined points.

Can BezierPatch only work using grid ? Or i could make really fine grid so user points could be adjusted to this fine grid ?

In example im trying there is this grid

_patchVerts =     [
                            
new Vertex150, -1500),
                            new 
Vertex50, -1500),
                            new 
Vertex( -50, -1500),
                            new 
Vertex( -150,  -1500),
                            new 
Vertex150, -500),
                            new 
Vertex50,  -500),
                            new 
Vertex( -50,  -500),
                            new 
Vertex( -150,  -500),
                            new 
Vertex150,  500),
                            new 
Vertex50,  500),
                            new 
Vertex( -50,  500), //10
                            
new Vertex( -150,  500),
                            new 
Vertex150,  1500),
                            new 
Vertex50,  1500),
                            new 
Vertex( -501500),
                            new 
Vertex( -150,  1500)
                    
]

and these nodes

_nodes["patch"= new Array(
                
0,  1,  2,  3,  4,  5,  6,  7,
                
8,  9101112131415
              
); 

I try to add smaller grid but get errors :

_nodes["patch"= new Array(
                
0,  1,  2,  3,  4,  5,  6,  7,
                
8,  910111213141516 ,17 181920 21 ,22 ,23 ,24
              
);

        private function 
getVertexs() : Array {
                
return    [
                            
new Vertex150, -1500),
                            new 
Vertex50, -1500),
                            new 
Vertex0, -1500), //
                            
new Vertex( -50, -1500),
                            new 
Vertex( -150,  -1500),


                            new 
Vertex150, -500),
                            new 
Vertex50,  -500),
                            new 
Vertex0,  -500), //
                            
new Vertex( -50,  -500),
                            new 
Vertex( -150,  -500),

                            new 
Vertex15000),//
                            
new Vertex50,  00),//
                            
new Vertex0,  00), //
                            
new Vertex( -50,  00),//
                            
new Vertex( -150,  00),//


                            
new Vertex150,  500),
                            new 
Vertex50,  500),
                            new 
Vertex0,  500),//
                            
new Vertex( -50,  500), //10
                            
new Vertex( -150,  500),

                            new 
Vertex150,  1500),
                            new 
Vertex50,  1500),
                            new 
Vertex0,  1500),//
                            
new Vertex( -501500),
                            new 
Vertex( -150,  1500)
                    
];
        

Am i doing this wrong ? And can i do this without the grid ?

   

Avatar
Greg Caldwell (Greg209), Administrator
Posted: 12 January 2012 04:23 PM   Total Posts: 45   [ # 1 ]

Hi,

The BezierPatches only use a 4x4 grid for each patch, although you can have multiple numbers of patches.

If you’re looking for greater control resolution of patches, you might like to try the NURBS primitive which allows a single patch with a user specific number of control points (horizontal & vertical) with weightings.

NURBS Tutorial - www.geepers.co.uk

Cheers

Greg

 Signature 

Home page : http://www.geepers.co.uk
Mobile apps : Sum It All Up

   

vegetable, Newbie
Posted: 12 January 2012 04:59 PM   Total Posts: 7   [ # 2 ]

Do you know any non away3d class/example that would allow me to use multiple control points , ideally irregular points.

   

Avatar
Greg Caldwell (Greg209), Administrator
Posted: 12 January 2012 10:31 PM   Total Posts: 45   [ # 3 ]

I’m afraid not. Sorry.

 Signature 

Home page : http://www.geepers.co.uk
Mobile apps : Sum It All Up

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X