Three.js A simple explanation of the order of textures added to the plane

Source: Internet
Author: User

//scenes scene //Camera Cameras //Renderer Render //Light omit do not write //1. Create geometry here is the plane width 960 high 480 above the grid is 1var geometry = new three. Planegeometry (960,480,1,1);//geometry creates a texture coordinate as if it were Four Corners Geometry.vertices[0].uv = new three.        Vector2 (0,0); GEOMETRY.VERTICES[1].UV = new three.        Vector2 (1,0); GEOMETRY.VERTICES[2].UV = new three.        Vector2 (a); GEOMETRY.VERTICES[3].UV = new three. Vector2 (0,1); //2 Get a picture of the texture inside this different version will have different methodsvar texture = three. Imageutils.loadtexture (//"Img3/1.png", this is relative position also line "HTTP://172.16.7.191/ANKANGTONG/THREE/IMG3 /1.png ",//This is the network location is also OK but most write null,function (t) {}); //3 Create a texture inside the texture because there's a picture in it, so it's equivalent to sticking a picture on the material.There's one-sided stickers and two side stickers here is the inside stickerThe main note is that the map,map inside the brackets is placed in the texture (here is the picture) that is downloaded to the objectvar material = new three. Meshbasicmaterial ({map:texture,transparent:true}); Material.side=three. doubleside;//single-sided paste on delete //4 Creating a mesh plane requires geometry and materialsvar mesh = new three. Mesh (geometry,material); Scene.add (mesh);//Add to the scene and set the mesh position to rotate what the last remember to render Renderer.render (scene, camera);

Three.js A simple explanation of the order of textures added to the plane

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.