SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast sumeshbabu's Avatar
    Join Date
    Nov 2007
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    3D rotation horizontal

    Hi,

    How do I rotate an object/movie clip horizontally, e.g. tree menu. There is an example in the below link: Anybody can help in scripting?

    http://pl.nokia.pl/modnanokia/nokial...x_eng.html?id=
    Last edited by sumeshbabu; Oct 16, 2008 at 02:36.

  2. #2
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is an example in the below link: Anybody can help in scripting?

  3. #3
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,514
    Mentioned
    37 Post(s)
    Tagged
    1 Thread(s)
    Super easy
    Code:
    //create some initial values
    
    circles = new Array();
    
    sw = Stage.width;
    sh = Stage.height;
    
    centre_x = Stage.width/2;
    centre_y = Stage.width/2;
    distance = 500; 
    angle = 0;
    
    // create some random coords for circles
    for(i=0;i<30;i++)
    {
    	circles[i]={a:random(360),h:random(sw/2)-200,r:50+random(100)};
    	this.attachMovie("mc","mc"+i,100+i);
    }
    
    this.createEmptyMovieClip("draw_mc",0);
    
    //update little circles and spin in 3d
    
    this.onEnterFrame = function()
    {
    	angle+=3;
    	draw_mc.clear();
    	
    	for(i=0;i<30;i++)
    	{
    		var mca = circles[i].a+angle;
    		var mcrad = (mca*Math.PI/180);
    		var mcr = circles[i].r
    		var mcx = Math.cos(mcrad)* mcr;
    		var mcy = circles[i].h;
    		var mcz = Math.sin(mcrad)* mcr;
    		var mcs = distance/(distance+mcz);
    		var mc = this["mc"+i];
    		var mc2dx = mc._x = (mcx*mcs) + centre_x;
    		var mc2dy = mc._y = (mcy*mcs) + centre_y;
    		mc._xscale = mc._yscale = mcs*100;
    		draw_mc.moveTo(centre_x,sh);
    		draw_mc.lineStyle(0,0x000000,100);
    		draw_mc.curveTo(centre_x,mc2dy,mc2dx,mc2dy);
    	}
    }

  4. #4
    SitePoint Enthusiast sumeshbabu's Avatar
    Join Date
    Nov 2007
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks EastCoast. There is no circle. Actullay I want only 3d rotating. I have already a movie clip like a tree and each line containing different icon. on mouse over this will shows a brief info. But I want to rotate this tree. If you can help me to rotate a movie clip is highly appreciable.

  5. #5
    SitePoint Enthusiast sumeshbabu's Avatar
    Join Date
    Nov 2007
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anybody can help me......?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •