Since Cult3d itself does not have modeling capabilities, it needs to be modeled with other tools before design, and the last time we learned how to model and import for Cult3d, after importing objects in Cult3d, we need to add events and actions to the object and generate a virtual 3D world. So, this time, let's take a look at how to edit objects in Cult3d to create a virtual 3D world. Initialize event start Cult3d into its main interface window, execute "file/addcult3ddesignerfile" command, and import a 3D object that we have designed Minidisc.c3d, the object appears in the preview window, which is a 3D object model of a CD player, as shown in Figure 1.
Figure 1
Here we need to initialize the object, first select the Worldstart event in the list on the left side of the event window, and drag to the right margin, and the Worldstart event will be raised after the Cult3d scene load initialization. When you are finished, drag the Acrball action under Objectmotion in the Actions window to the Worldstart event, Acrball action to rotate or move objects when you drag the mouse in the window. For this action you can also set the function of the mouse-specific key, such as the axis of rotation or direction of movement. Finally, expand the Object branch in the scene map (scenegraph) window and drag MiniDisc onto the Acrball action in the event window, as shown in Figure 2. Then we completed a simple interactive action design, in the Preview window, click the Play button, and then click on the 3D object left mouse button and drag, you will find 3D objects rotate! To design the playback button The next thing we want to do is to add a control switch for the CD player to play and stop playing. First you want to import a piece of music for the CD player, preferably mid format music, so you can ensure that the final generated file is not very large. Right-click "Sound" in the Scene map window and select "New/sound" in the pop-up shortcut menu, select the mid music you have prepared in the Open dialog box, and then display the music files you've added in the Scene Map window and the Music control window when you're done.
Figure 2
Return to the Event window, select the "Leftmouseclickonobject" event in the list box on the left and drag and drop it to the empty area on the right, and right-click the event and choose "ChangeName" from the Open shortcut menu to name the event play. The Button-playpause object is then dragged onto the play event in the scene window to achieve playback and pause functions. When finished, open the Action window, drag the PlaySound action under "Sound" to the play event, and finally drag and drop the sound under "Sounds" in the scene diagram window onto the PlaySound action, as shown in Figure 3. So we can finish the design of the play button. When you move the mouse to the play button on the CD player in the preview window, you will see that it becomes a hand type, and you can start playing the music you just imported by clicking it.
Figure 3
Design Stop button
After completing the design of the playback key, let's design the music button to stop playing. Here you need to use the Button-stop object in the CD player 3D model. First drag the Leftmouseclickonobject event on the left side of the event window to the right margin and name stop, and then drag the Button-stop object to the stop event in the scene window. When you are done, drag the Stopsound action to the Stop event in the Action window under Sound, and drag the sound file under "Sounds" in the scene map to the Stopsound action, as shown in Figure 4. So we can stop playing the music when we preview it by clicking the Stop button.
Figure 4
Design the opening button below to design a switch for the CD player to open the door. Drag the Leftmouseclickonobject event on the left side of the event window to the empty area on the right, name it open, and then drag the rotationxyz action under "Objectmotion" in the action window to the open event in the Event Diagram window. Drag and drop the Minndisc-reflectivetop object in the Scene diagram window onto the rotationxyz action of the event window, and then drag the Mididisc-case-openning object onto the event diagram's Open event in the Scene Diagram window.
Figure 5
Double-click the ROTATIONXYZ action to open the Rotationxyz Action Settings dialog box, where the 180 in the Rotationxyxcontrols box indicates a counter-clockwise rotation 180°,2000 indicates that the angle is rotated 2 seconds, and can be set according to our needs. In addition to the previous introduction, we can add more interactive events to the CD player, such as fast-forward, adjust the volume, and so on, according to the specific composition of the model to design, and finally we can use this player in the preview window, as shown in Figure 5. This time we learned how to build a 3D object, with very rich events and actions available for us to use in Cult3d, in the next installment we'll look at some of the common Cult3d events and actions that will help us better use it and make our own 3D work.