Nvisionxr_ios Tutorial Eight--adding particles to the scene

Source: Internet
Author: User

This section describes how to add particle effects to your scene. Open the code for the previous section
1. Add header file #import ' NVWorldParticles.h ' 
2. Drag the particle's resource file into the userres.bundle directory(The resources in this section are available below the tutorial) 
 

3. About making particle files, this is not a narrative, please see the tutorial "nvisionxr engine Basic introduction http://www.arvrschool.com/read-7381"  )

4. Click Particle file, view the material name, and thenuserres.materialto configure the material path, such as:
 

in theonCreatemethod to instantiate a particle in a session, such as:
 
Code: 

Nvworldparticles *snow = (nvworldparticles *) [[Self Getworld] getobjectbyname:@ "Snow"];         if (!snow) {snow = (nvworldparticles *) [[self Getworld] createobject:particles objectname:@ "Snow"];         Set the particle script name [Snow settechnique:@ "Snow"];     Set particle coordinates in space [snow setposition:nvposition (0.0, 20.0, 0.0)]; }



in theOnstratmethod to attach particles to the scene, such as
 
Code:

Nvworldparticles *snow = (nvworldparticles *) [[Self Getworld] getobjectbyname:@ "Snow"];         if (snow) {[Snow attachto:self];     The particle system starts playing [snow start]; }



in theOnStopmethod to remove particles from the scene, such as
 
Code: 

Nvworldparticles *snow = (nvworldparticles *) [[Self Getworld] getobjectbyname:@ "Snow"];         if (snow) {//Control particle system end [snow stop];     [Snow Dettach]; }



To run the project, you can see such effects as:

The particle effect is added successfully, and you can try to use the particle editor to do a cool particle effect loading into the scene.

Nvisionxr_ios Tutorial Eight--adding particles to the scene

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.