Nvisionxr_ios Tutorial Six--object interaction in the scene

Source: Internet
Author: User

This section describes how to interact with the objects in the scene, followed by the code in the previous section, where we go toward the cube object
Add the following code and implement its proxy<HitEventDelegate> 


Code: 

    //  create a cube       nvboxwidget *cube = [[nvboxwidget alloc] initwithsceneplay:self widgetname:@ " Cube "];     //  adds a material, passing in the corresponding material  material name      [cube  setappearance:@ "Cubetex"];     //  set coordinates      [cube  setposition:nvposition (0, 0, 0)];     //  set zoom ratio       [cube setscale:nvposition (1.0, 1.0, 1.0)];     //   Set Click Pick Events      [cube setClickEnadble];      cube.delegate = self;          //  adding objects to the scene      [self addwidget:cube]; 



Click on the agent, you can see the method inside, we realize
 
Code:

Click Event-(void) OnClick: (Nvwidget *) widget {//clicked object is consistent with the object name of the cube if ([[Widget GetName] isequaltostring:@ "Cube"])     {NSLog (@ "Click to Cube"); } }



run the project and click on the cube to see the console print the log
 

With This proxy, you can interact with the objects in the scene. The contents of this chapter are ended here, the next chapter
section, I will teach you to let this cube move.

Welcome to contact:

    • Contact information: +86 18801341080

    • E-mail: [email protected]

    • Website: http://www.nvisionxr.com/

    • QQ Group: 416802300


Nvisionxr_ios Tutorial Six--object interaction in 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.