static void Main(string[] args) { asd.Engine.Initialize("ShaderTest", 800, 600, new asd.EngineOption()); var obj = new TextureObject2DWithNormalMapping(); obj.Position = new asd.Vector2DF(100, 100); obj.Texture = asd.Engine.Graphics.CreateTexture2D("TestKomarigaoBumpGrayscale.png"); obj.NormalMap = asd.Engine.Graphics.CreateTexture2DAsRawData("TestKomarigaoNormalMap.png"); asd.Engine.AddObject2D(obj); var obj2 = new TextureObject2DWithNormalMapping(); obj2.Position = new asd.Vector2DF(300, 100); obj2.Texture = asd.Engine.Graphics.CreateTexture2D("Normal_map_example_with_scene_and_result.png"); obj2.NormalMap = asd.Engine.Graphics.CreateTexture2DAsRawData("Normal_map_example_with_scene_and_result2.png"); asd.Engine.AddObject2D(obj2); var geo = new asd.GeometryObject2D() { Shape = new asd.CircleShape() { InnerDiameter = 0, NumberOfCorners = 8, OuterDiameter = 16, }, Color = new asd.Color(255, 0, 0), DrawingPriority = 20, }; asd.Engine.AddObject2D(geo); while (asd.Engine.DoEvents()) { asd.Engine.Update(); var mp = asd.Engine.Mouse.Position; geo.Position = mp; var lv = new asd.Vector3DF(mp.X, mp.Y, 20); obj.LightSource = lv; obj.Angle += 0.1f; obj2.LightSource = lv; } asd.Engine.Terminate(); }
/** * @brief * @param name * @param rotationOrder * @param localMat * @param globalMatInv */ /// <summary> /// ボーンを追加する。 /// </summary> /// <param name="name">ボーンの名称</param> /// <param name="parentBoneIndex">親ボーンのインデックス(親がない場合は-1)</param> /// <param name="rotationOrder">ボーンの回転行列の計算方法</param> /// <param name="localMat">ボーンのローカル変形行列</param> public void AddBone(string name, int parentBoneIndex, RotationOrder rotationOrder, asd.Matrix44 localMat, asd.Vector3DF translation, asd.Vector4DF rotation, asd.Vector3DF scaling) { CoreInstance.AddBone(name, parentBoneIndex, (swig.RotationOrder)rotationOrder, ref localMat, ref translation, ref rotation, ref scaling); }
public static LightType Directional(asd.Vector3DF direction) { direction.Normalize(); return(new LightType(true, direction)); }
public static LightType Point(asd.Vector3DF pos) => new LightType(false, pos);
private LightType(bool isDirectional, asd.Vector3DF p) { this.isDirectional = isDirectional; this.p = p; }