зеркало из https://github.com/xamarin/ios-samples.git
[ios11] animate in ARKit
This commit is contained in:
Родитель
4523919c03
Коммит
cc34787aff
|
@ -73,11 +73,26 @@ namespace ARKitSample
|
|||
// Run the view's session
|
||||
SceneView.Session.Run(configuration);
|
||||
|
||||
|
||||
|
||||
// Find the ship and position it just in front of the camera
|
||||
var ship = SceneView.Scene.RootNode.FindChildNode("ship", true);
|
||||
ship.Position = new SCNVector3(2f, -2f, -9f);
|
||||
|
||||
|
||||
ship.Position = new SCNVector3(2f, -2f, -9f);
|
||||
//HACK: to see the jet move (circle around the viewer in a roll), comment out the ship.Position line above
|
||||
// and uncomment the code below (courtesy @lobrien)
|
||||
|
||||
//var animation = SCNAction.RepeatActionForever(SCNAction.RotateBy(0, (float)Math.PI, (float)Math.PI, (float)1));
|
||||
//var pivotNode = new SCNNode { Position = new SCNVector3(0.0f, 2.0f, 0.0f) };
|
||||
//pivotNode.RunAction(SCNAction.RepeatActionForever(SCNAction.RotateBy(0, -2, 0, 10)));
|
||||
//ship.RemoveFromParentNode();
|
||||
//pivotNode.AddChildNode(ship);
|
||||
//SceneView.Scene.RootNode.AddChildNode(pivotNode);
|
||||
//ship.Scale = new SCNVector3(0.1f, 0.1f, 0.1f);
|
||||
//ship.Position = new SCNVector3(2f, -2f, -3f);
|
||||
//ship.RunAction(SCNAction.RepeatActionForever(SCNAction.RotateBy(0, 0, 2, 1)));
|
||||
|
||||
//ENDHACK
|
||||
}
|
||||
|
||||
public override void ViewWillDisappear(bool animated)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<IsFullApplication>false</IsFullApplication>
|
||||
<Level>Intermediate</Level>
|
||||
<Tags>iOS11</Tags>
|
||||
<SupportedPlatforms>iOS</SupportedPlatforms>
|
||||
<Gallery>true</Gallery>
|
||||
<Brief>Simple example using ARKit in iOS 11.</Brief>
|
||||
</SampleMetadata>
|
||||
|
|
|
@ -7,8 +7,9 @@ To test this sample you'll need to deploy it on a device running iOS 11 beta sof
|
|||
|
||||
![AR Jet](Screenshots/jet.png)
|
||||
|
||||
By default, the sample presents a jet in a fixed location. To animate the jet around the viewer find the `HACK` in **GameViewController.cs**: comment out the line `ship.Position = new SCNVector3(2f, -2f, -9f);` and uncomment the code that creates an animation around a pivot node.
|
||||
|
||||
Author
|
||||
------
|
||||
|
||||
Kevin Mullins
|
||||
Kevin Mullins, Larry O'Brien
|
||||
|
|
Загрузка…
Ссылка в новой задаче