Flex Development Away3d Set Sphere spheregeometry skin (solid color, texture)

Source: Internet
Author: User
Tags addchild

1, set the spheregeometry to the skin of the pure color

Because only set the color, so if the stage does not add lights can not see the corner of the stereo effect.

The code is as follows Copy Code


var material:colormaterial = new Colormaterial (0XFFFFFF);

Create a sphere on a three-dimensional stage
var Sphere:mesh = new Mesh (new Spheregeometry (), material);
_view3d.scene.addchild (Sphere);

2, set the texture skin for spheregeometry

By default, if you set a texture to the sphere, the picture is wrapped around the whole circle of the sphere.

  code is as follows copy code

[Embed ( Source= "Assets/beachball_diffuse.jpg")]
public static var beachballdiffuse:class;
 
 
var material:texturematerial = new Texturematerial (Cast.bitmaptexture (beachballdiffuse));
 
//Create a sphere in the three-dimensional stage     
var sphere:mesh = new Mesh (New Spheregeometry, MA Terial);
_view3d.scene.addchild (sphere);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.