Threejs loads the DAE model and summarizes threejsdae.

Source: Internet
Author: User

Threejs loads the DAE model and summarizes threejsdae.

Threejs load DAE model Summary

Beautiful Life of the sun and fire god (http://blog.csdn.net/opengl_es)

This article follows the "signature-non-commercial use-consistency" creation public agreement

Reprinted please keep this sentence: Sun huoshen's beautiful life-this blog focuses on Agile development and mobile and IOT device research: iOS, Android, Html5, Arduino, pcDuino, otherwise, this blog post is rejected or reprinted. Thank you for your cooperation.



Let's take a look at the official Threejs example:

Http://threejs.org/examples/#webgl_loader_collada_skinning


Http://threejs.org/examples/webgl_loader_collada_skinning.html

<!DOCTYPE html>

The loaded dae Model
 "./models/collada/avatar.dae",

The complete address is as follows:

Http://threejs.org/examples/models/collada/avatar.dae

You can directly select the downloaded avatar. dae from the Finder of the Mac operating system and press a space to pop up the display window. The effect is as follows:


Open avatar. dae In the text editor and search for the library_images keyword. Find the following section:

 <library_images>    <image id="VWS_B_Male2-2_jpg">      <init_from>VWS_B_Male2-2.jpg</init_from>    </image>  </library_images>

Concatenate the complete address of the texture File Based on the path relative to dae:

Http://threejs.org/examples//models/collada/VWS_ B _Male2-2.jpg


Download the texture and save it to the same directory of avatar. dae. Then you can use the Finder to view the pasted model.

It can be seen that dae is a complete self-maintenance model. The xml Information in it is sufficient to present and map the model carried by it, even lighting, animation, and so on.


From the following perspective, we can see that the model has a highlighted part. Here we can preliminarily conclude that it is the light information on the image, that is, the texture is baked with the light information.


It can be confirmed that non-ambient light is taken. The following code uses xcode to open dae and the Lights part is empty, indicating that no light is available.


Here is a tip. If the dae model you get contains a light source and you do not want an environmental light source, you can open this dae in a text editor and find the ambient XML tag:

        <ambient>          <color></color>        </ambient>

Remove the color content, namely the three-color value of ambient light, so that ambient light does not work.







An example of loading and controlling the dae model for flash away3D

You can use the pv3d class library based on flash cs3 and as 3.0 to export the file by using 3 DMAX and other software. model files in DAE format can be directly imported and used in pv3d, and 3D images can be generated in flash, such as rotating and moving, and scaling.

Download pv3d:

For the pv3d tutorial, please find it on this website:
 

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.