Example: /Mac64bit/SceneKit/Rotation

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/Mac64bit/SceneKit/Rotation


Required plugins for this example: MBS Mac64bit Plugin, MBS MacBase Plugin, MBS MacCG Plugin, MBS Main Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Mac64bit/SceneKit/Rotation

This example is the version from Fri, 30th Apr 2020.

Project "Rotation.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control Mapp Inherits SCNControlMBS
ControlInstance Mapp Inherits SCNControlMBS
EventHandler Sub Open() MyView = Me.View MyScene = New SCNSceneMBS MyView.scene = MyScene myView.autoenablesDefaultLighting = True MyView.allowsCameraControl = True myView.backgroundColor = NSColorMBS.blackColor Rotate90Degree End EventHandler
End Control
Sub Rotate90Degree() //Add the Node to the Scene Dim NodeOneGeometry As New SCNPyramidMBS(1, 1, 1) Dim NodeOne As New SCNNodeMBS(NodeOneGeometry) NodeOneGeometry.firstMaterial.diffuse.contents = NSColorMBS.purpleColor NodeOne.Position = New SCNVector3MBS(0, 0, 0) MyScene.rootNode.addChildNode(NodeOne) //The angle must be given as radians //Convert: angleDegree*(Pi/180) Dim angleDegree As Double = 90 Const Pi = 3.14159265358979323846264338327950 Dim angleRad As Double angleRad = angleDegree * (Pi / 180) //create the movements Dim rotate90 As SCNActionMBS = SCNActionMBS.rotateBy(angleRad, 0, 0, 2) Dim moveBy As SCNActionMBS = SCNActionMBS.moveBy(1, 0, 0, 1) Dim pos As New SCNVector3MBS(0, 0, 0) Dim moveTo As SCNActionMBS = SCNActionMBS.moveTo(pos, 1) Dim sequence As SCNActionMBS = SCNActionMBS.sequence(Array (rotate90, moveBy, moveTo)) Dim repeat As SCNActionMBS = SCNActionMBS.repeatActionForever(sequence) NodeOne.runAction(repeat) End Sub
Property MyScene As SCNSceneMBS
Property MyView As SCNViewMBS
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

The items on this page are in the following plugins: MBS Mac64bit Plugin.


💬 Ask a question or report a problem