本文整理汇总了C#中SceneManager.AddSphereSceneNode方法的典型用法代码示例。如果您正苦于以下问题:C# SceneManager.AddSphereSceneNode方法的具体用法?C# SceneManager.AddSphereSceneNode怎么用?C# SceneManager.AddSphereSceneNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SceneManager
的用法示例。
在下文中一共展示了SceneManager.AddSphereSceneNode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
device = IrrlichtDevice.CreateDevice(DriverType.OpenGL, new Dimension2Di(800, 600));
device.SetWindowCaption("Sphere Camera - Irrlicht Engine");
driver = device.VideoDriver;
scene = device.SceneManager;
sphere = scene.AddSphereSceneNode(5, 100);
sphere.SetMaterialTexture(0, driver.GetTexture("../../media/earth.jpg"));
sphere.TriangleSelector = scene.CreateTriangleSelector(sphere.Mesh, sphere);
sphere.TriangleSelector.Drop();
scene.AmbientLight = new Colorf(0.2f, 0.2f, 0.2f);
LightSceneNode light = scene.AddLightSceneNode();
light.Position = new Vector3Df(-10, 10, -10);
camera = new SphereCamera(device, new Vector3Df(0), 8, 20, 10, 0, 0);
camera.Inclination = 200;
path = new SpherePath(5.4f);
GUIFont font = device.GUIEnvironment.BuiltInFont;
device.OnEvent += new IrrlichtDevice.EventHandler(device_OnEvent);
device.PostEvent(new Event('r', KeyCode.KeyR, true)); // pretend user pressed [R]
while (device.Run())
{
driver.BeginScene();
scene.DrawAll();
path.Draw(driver);
font.Draw("Press [Arrows], [LMB] and [Mouse Scroll] to change view", 10, 10, Color.OpaqueYellow);
font.Draw("Press [RMB] on Earth to place new path point", 10, 20, Color.OpaqueYellow);
font.Draw("Press [R] to reload path data from file", 10, 30, Color.OpaqueYellow);
font.Draw("Press [C] to clean up", 10, 40, Color.OpaqueYellow);
font.Draw(driver.FPS.ToString() + " fps", 10, driver.ScreenSize.Height - 40, Color.OpaqueYellow);
font.Draw(path.PointCount.ToString() + " point(s)", 10, driver.ScreenSize.Height - 30, Color.OpaqueYellow);
font.Draw(camera.ToString(), 10, driver.ScreenSize.Height - 20, Color.OpaqueYellow);
driver.EndScene();
}
path.Drop();
device.Drop();
}
示例2: createScreen
//.........这里部分代码省略.........
anode2.SetTransitionTime(3);
Scenes.changeYodanAnimation(anode2, "idle");
//SkyBox
SceneNode skybox = smgr.AddSkyBoxSceneNode("./Contents/2D/Skybox/mountains_up.jpg", "./Contents/2D/Skybox/mountains_dn.jpg", "./Contents/2D/Skybox/mountains_lf.jpg", "./Contents/2D/Skybox/mountains_rt.jpg", "./Contents/2D/Skybox/mountains_ft.jpg", "./Contents/2D/Skybox/mountains_bk.jpg");
skybox.Visible = true;
//FPS kamera hozzáadása
camera = smgr.AddCameraSceneNodeFPS();
camera.Position = new Vector3Df(-1625.723f, -145.9937f, -1532.087f);
camera.Target = new Vector3Df(-1491.555f, -1434.106f, -1368.737f);
//fegyver
AnimatedMesh weaponmesh = smgr.GetMesh("./Content/3D/blades.mdl");
AnimatedMeshSceneNode weapon = smgr.AddAnimatedMeshSceneNode(weaponmesh, camera, 30);
weapon.Scale = new Vector3Df(0.5f, 0.5f, 0.5f);
weapon.Position = new Vector3Df(0, 0, 15);
weapon.Rotation = new Vector3Df(0, -90, 0);
Scenes.changeAnimation(weapon, 1, 1);
weapon.Visible = true;
//fizika
TriangleSelector selector;
selector = smgr.CreateOctreeTriangleSelector(q3levelmesh.GetMesh(0), q3node, 128);
q3node.TriangleSelector = selector;
anim = smgr.CreateCollisionResponseAnimator(selector, camera, new Vector3Df(30, 50, 30), new Vector3Df(0, -10, 0), new Vector3Df(0, 30, 0));
//Overlay
GUIImage overlay = device.GUIEnvironment.AddImage(driver.GetTexture("./Content/2D/Overlays/vignette.png"), new Vector2Di(0, 0));
overlay.ScaleImage = true;
overlay.SetMaxSize(new Dimension2Di(sizex, sizey));
overlay.SetMinSize(new Dimension2Di(sizex, sizey));
selector.Drop();
camera.AddAnimator(anim);
anim.Drop();
// fény
lightMovementHelperNode = smgr.AddEmptySceneNode();
q3node = smgr.AddSphereSceneNode(2, 6, lightMovementHelperNode, -1, new Vector3Df(15, -10, 15));
q3node.SetMaterialFlag(MaterialFlag.Lighting, false);
lightNode = q3node;
//A Portré
anode = smgr.AddAnimatedMeshSceneNode(smgr.GetMesh("./Content/3D/portrait.mdl"));
anode.Position = new Vector3Df(-1177.601f, -137.975f, -1238.015f);
anode.Rotation = new Vector3Df(0,0,0);
anode.Scale = new Vector3Df(3);
anode.AnimationSpeed = 1500;
anode.SetMaterialFlag(MaterialFlag.Lighting, true);
anode.GetMaterial(0).NormalizeNormals = true;
anode.GetMaterial(0).Lighting = false;
AnimatedMeshSceneNode anode4 = smgr.AddAnimatedMeshSceneNode(smgr.GetMesh("./Content/3D/waiter.mdl"));
anode4.Position = new Vector3Df(-1130, -375, -1724);
anode4.Rotation = new Vector3Df(0, -90, 0);
anode4.Scale = new Vector3Df(2, 2, 2);
anode4.SetMaterialFlag(MaterialFlag.Lighting, false);
Scenes.changeAnimation(anode4, 0, 1);
//Egér elrejtése
device.CursorControl.Visible = false;
GUIFont font = device.GUIEnvironment.BuiltInFont;
SceneCollisionManager collMan = smgr.SceneCollisionManager;
TextSceneNode headcrabName = smgr.AddTextSceneNode(font, "Yodan Lebegö Headcrab-je <Level 10>", new Color(255, 255, 0), null, anode3.Position + new Vector3Df(0, 25, 0), 0);
TextSceneNode waiterName = smgr.AddTextSceneNode(font, "John <Level 15>", new Color(0, 255, 0), null, anode4.Position + new Vector3Df(0, 125, 0), 0);
uint then = device.Timer.Time;
float MOVEMENT_SPEED = 100.0f;
//Energiagömb
/*AnimatedMeshSceneNode anode5 = smgr.AddAnimatedMeshSceneNode(smgr.GetMesh("./Content/3D/core.mdl"));