SCNText not showing in SceneKit

WestonWWestonW USMember ✭✭
edited December 2018 in Xamarin.iOS

I'm trying to add a simple text overlay in my 3D scene and nothing is showing up. For reference a SCNBox adds and displays just fine. Help?

SCNNode PlaceText(SCNVector3 pos)
{
    var text = SCNText.Create("hello world", 5);
    text.Font = UIFont.FromName("Avenir Heavy", 50);
    text.ChamferRadius = 0.3f;
    text.Flatness = 0.1f;
    text.FirstMaterial.Diffuse.Contents = UIColor.White;
    text.FirstMaterial.Specular.Contents = UIColor.Blue;

    var offset = new SCNVector3(0.2f, 0.2f, 0.2f);
    offset = SCNVector3.Add(pos, offset);

    var textNode = new SCNNode { Position = offset, Geometry = text };
    scnView.Scene.RootNode.AddChildNode(textNode);

    return textNode;
}
Tagged:

Best Answer

Answers

Sign In or Register to comment.