Cocos2d-x Study Notes 1 Sprite3D, cocos2d-xsprite3d

Source: Internet
Author: User

Cocos2d-x Study Notes 1 Sprite3D, cocos2d-xsprite3d

1 FBX is a common export format, which can be exported through maya or max.

2File formats

1) obj: obj is a default export format that can be exported by max or maya without any conversion. However, it does not support animation export.

2) The c3t file is a Json format file generated after the FBX model file is converted. The c3t format is used to facilitate you to view model data and compare the version, since the c3t file is in Json format, the file size is large and the loading speed is slow. It is not recommended in actual games.

3) c3b: c3b is a binary file. The data content is the same as that of c3t files. The difference is that c3b files are small in size and can be loaded quickly. Therefore, it is recommended to be used in actual game development.

C3t and c3b are obtained after secondary conversion through the FBX model file.

3 Max export FBX format, and then use * \ cocos2d-x-3.3rc0 \ tools \ fbx-conv \ win \ fbx-conv.exe through FBX_CONV_DIR-a xx. fbx (FBX_CONV_DIR is the complete path of the conversion plug-in xx/fbx-conv).-a in the command indicates that the c3b and c3t files are output simultaneously, you can also use-B or-t to output c3b or-c3t files separately. The converted files will be generated to the current directory.

4. Use the following code to implement the 3D genie

Auto tortoise = Sprite3D: create ("tortoise. c3b "); // create a 3D sprite tortoise-> setScale (0.3f); // set the zooming ratio of the sprite tortoise-> setPosition (Point (visibleSize. width/2, visibleSize. height/2); addChild (tortoise); // create an animation auto animation = Animation3D: create ("tortoise. c3b "); if (animation) {auto animate = Animate3D: create (animation); animate-> setSpeed (2.0f ); // set the animation playback speed tortoise-> runAction (RepeatForever: create (animate ));}

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.