本文整理汇总了C#中Axiom.Core.SceneNode类的典型用法代码示例。如果您正苦于以下问题:C# SceneNode类的具体用法?C# SceneNode怎么用?C# SceneNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SceneNode类属于Axiom.Core命名空间,在下文中一共展示了SceneNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateScene
public override void CreateScene()
{
viewport.BackgroundColor = ColorEx.Black;
scene.AmbientLight = ColorEx.Gray;
Light light = scene.CreateLight( "MainLight" );
light.Position = new Vector3( 20, 80, 50 );
light.Diffuse = ColorEx.Blue;
scene.LoadWorldGeometry( "JigLibX_Terrain.xml" );
scene.SetFog( FogMode.Exp2, ColorEx.White, .008f, 0, 250 );
// water plane setup
Plane waterPlane = new Plane( Vector3.UnitY, 1.5f );
MeshManager.Instance.CreatePlane(
"WaterPlane",
ResourceGroupManager.DefaultResourceGroupName,
waterPlane,
2800, 2800,
20, 20,
true, 1,
10, 10,
Vector3.UnitZ );
Entity waterEntity = scene.CreateEntity( "Water", "WaterPlane" );
waterEntity.MaterialName = "Terrain/WaterPlane";
waterNode = scene.RootSceneNode.CreateChildSceneNode( "WaterNode" );
//waterNode.AttachObject( waterEntity );
waterNode.Translate( new Vector3( 1000, 0, 1000 ) );
}
示例2: SetupContent
/// <summary>
///
/// </summary>
protected override void SetupContent()
{
SceneManager.SetSkyBox( true, "Examples/EveningSkyBox", 5000 );
// dim orange ambient and two bright orange lights to match the skybox
SceneManager.AmbientLight = new ColorEx( 0.3f, 0.2f, 0.0f );
Light light = SceneManager.CreateLight( "Light1" );
light.Position = new Vector3( 2000, 1000, -1000 );
light.Diffuse = new ColorEx( 1.0f, 0.5f, 0.0f );
light = SceneManager.CreateLight( "Light2" );
light.Position = new Vector3( 2000, 1000, 1000 );
light.Diffuse = new ColorEx( 1.0f, 0.5f, 0.0f );
_pivot = SceneManager.RootSceneNode.CreateChildSceneNode(); // create a pivot node
// create a child node and attach ogre head and some smoke to it
SceneNode headNode = _pivot.CreateChildSceneNode( new Vector3( 100, 0, 0 ) );
headNode.AttachObject( SceneManager.CreateEntity( "Head", "ogrehead.mesh" ) );
headNode.AttachObject( ParticleSystemManager.Instance.CreateSystem( "Smoke", "Examples/Smoke" ) );
Camera.Position = new Vector3( 0.0f, 30.0f, 350.0f );
base.SetupContent();
}
示例3: TestRecreationOfChildNodeAfterRemovalByReference
public void TestRecreationOfChildNodeAfterRemovalByReference()
{
Node node = new SceneNode( this.fakeSceneManager );
Node childNode = node.CreateChild( Name );
node.RemoveChild( childNode );
node.CreateChild( Name );
}
示例4: MultiLights
public MultiLights(SceneManager pSceneManager, SceneNode pCamNode, MovingObject pPlayerShip, Int32 pNumberOfLights)
{
oldCamLightColor = CamLightColor = new ColorEx(0.13f, 0.1f, 0.05f);
PlayerLightColor = ColorEx.White;
camLights = new List<Light>(pNumberOfLights);
innerLights = (Int32)Math.Round(pNumberOfLights / 3.0f, MidpointRounding.AwayFromZero);
outerLights = pNumberOfLights - innerLights;
// create the playership's light.
playerLight = pSceneManager.CreateLight("playerSpotLight");
playerLight.Type = LightType.Spotlight;
playerLight.Diffuse = PlayerLightColor;
playerLight.Specular = ColorEx.White;
playerLight.SetSpotlightRange(0.0f, 120.0f);
playerLight.Direction = Vector3.NegativeUnitZ;
playerLightNode = pPlayerShip.Node.CreateChildSceneNode();
playerLightNode.AttachObject(playerLight);
playerLightNode.Position = new Vector3(0, 0, 0);
playerLightNode.SetDirection(new Vector3(1, 0, 0), TransformSpace.Local);
// create the camera spotlights around the camera's direction.
camInnerLightNode = pCamNode.CreateChildSceneNode();
camInnerLightNode.Position = new Vector3(0, 0, 0);
camOuterLightNode = pCamNode.CreateChildSceneNode();
camOuterLightNode.Position = new Vector3(0, 0, 0);
for (var i = 0; i < innerLights; i++)
{
var light = pSceneManager.CreateLight("camInnerLight " + (i + 1));
light.Type = LightType.Spotlight;
light.Diffuse = CamLightColor;
light.Specular = ColorEx.White;
light.SetSpotlightRange(0.0f, 25.0f);
light.Direction = Quaternion.FromAngleAxis(360.0 * i / innerLights * Constants.DegreesToRadians, Vector3.UnitZ) *
Quaternion.FromAngleAxis(10.0 * Constants.DegreesToRadians, Vector3.UnitX) *
Vector3.NegativeUnitZ;
camLights.Add(light);
camInnerLightNode.AttachObject(light);
}
for (var i = 0; i < outerLights; i++)
{
var light = pSceneManager.CreateLight("camOuterLight " + (i + 1));
light.Type = LightType.Spotlight;
light.Diffuse = CamLightColor;
light.Specular = ColorEx.White;
light.SetSpotlightRange(0.0f, 25.0f);
light.Direction = Quaternion.FromAngleAxis(360.0 * i / outerLights * Constants.DegreesToRadians, Vector3.UnitZ) *
Quaternion.FromAngleAxis(20.0 * Constants.DegreesToRadians, Vector3.UnitX) *
Vector3.NegativeUnitZ;
camLights.Add(light);
camOuterLightNode.AttachObject(light);
}
}
示例5: CreateScene
public void CreateScene()
{
_entity = _root.SceneManager.CreateEntity("BasicCube", PrefabEntity.Cube);
_entity.MaterialName = "Examples/TestImage";
_sceneNode = Root.Instance.SceneManager.RootSceneNode.CreateChildSceneNode();
_sceneNode.Position = new Vector3(150, 0, -300);
_sceneNode.AttachObject(_entity);
_sceneNode.Yaw(45);
}
示例6: CreateScene
public override void CreateScene()
{
if ( !Root.Instance.RenderSystem.Capabilities.HasCapability( Capabilities.VertexPrograms ) ||
!Root.Instance.RenderSystem.Capabilities.HasCapability( Capabilities.FragmentPrograms ) )
{
throw new Exception( "Your hardware does not support vertex and fragment programs, so you cannot run this demo." );
}
// create a simple default point light
Light light = scene.CreateLight( "MainLight" );
light.Position = new Vector3( 20, 80, 50 );
rotNode = scene.RootSceneNode.CreateChildSceneNode();
rotNode.CreateChildSceneNode( new Vector3( 20, 40, 50 ), Quaternion.Identity ).AttachObject( light );
Entity entity = scene.CreateEntity( "Head", "ogrehead.mesh" );
camera.Position = new Vector3( 20, 0, 100 );
camera.LookAt( Vector3.Zero );
// eyes
SubEntity subEnt = entity.GetSubEntity( 0 );
subEnt.MaterialName = "Examples/CelShading";
subEnt.SetCustomParameter( CustomShininess, new Vector4( 35.0f, 0.0f, 0.0f, 0.0f ) );
subEnt.SetCustomParameter( CustomDiffuse, new Vector4( 1.0f, 0.3f, 0.3f, 1.0f ) );
subEnt.SetCustomParameter( CustomSpecular, new Vector4( 1.0f, 0.6f, 0.6f, 1.0f ) );
// skin
subEnt = entity.GetSubEntity( 1 );
subEnt.MaterialName = "Examples/CelShading";
subEnt.SetCustomParameter( CustomShininess, new Vector4( 10.0f, 0.0f, 0.0f, 0.0f ) );
subEnt.SetCustomParameter( CustomDiffuse, new Vector4( 0.0f, 0.5f, 0.0f, 1.0f ) );
subEnt.SetCustomParameter( CustomSpecular, new Vector4( 0.3f, 0.5f, 0.3f, 1.0f ) );
// earring
subEnt = entity.GetSubEntity( 2 );
subEnt.MaterialName = "Examples/CelShading";
subEnt.SetCustomParameter( CustomShininess, new Vector4( 25.0f, 0.0f, 0.0f, 0.0f ) );
subEnt.SetCustomParameter( CustomDiffuse, new Vector4( 1.0f, 1.0f, 0.0f, 1.0f ) );
subEnt.SetCustomParameter( CustomSpecular, new Vector4( 1.0f, 1.0f, 0.7f, 1.0f ) );
// teeth
subEnt = entity.GetSubEntity( 3 );
subEnt.MaterialName = "Examples/CelShading";
subEnt.SetCustomParameter( CustomShininess, new Vector4( 20.0f, 0.0f, 0.0f, 0.0f ) );
subEnt.SetCustomParameter( CustomDiffuse, new Vector4( 1.0f, 1.0f, 0.7f, 1.0f ) );
subEnt.SetCustomParameter( CustomSpecular, new Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
// add entity to the root scene node
scene.RootSceneNode.CreateChildSceneNode().AttachObject( entity );
window.GetViewport( 0 ).BackgroundColor = ColorEx.White;
}
示例7: SetupContent
/// <summary>
///
/// </summary>
protected override void SetupContent()
{
this.ptex = TextureManager.Instance.CreateManual( "DynaTex", ResourceGroupManager.DefaultResourceGroupName,
TextureType.ThreeD, 64, 64, 64, 0, Media.PixelFormat.A8R8G8B8,
TextureUsage.Default, null );
SceneManager.AmbientLight = new ColorEx( 0.6f, 0.6f, 0.6f );
SceneManager.SetSkyBox( true, "Examples/MorningSkyBox", 50 );
Light light = SceneManager.CreateLight( "VolumeTextureSampleLight" );
light.Diffuse = new ColorEx( 0.75f, 0.75f, 0.80f );
light.Specular = new ColorEx( 0.9f, 0.9f, 1 );
light.Position = new Vector3( -100, 80, 50 );
SceneManager.RootSceneNode.AttachObject( light );
// Create volume renderable
this.snode = SceneManager.RootSceneNode.CreateChildSceneNode( Vector3.Zero );
this.vrend = new VolumeRendable( 32, 750, "DynaTex" );
this.snode.AttachObject( this.vrend );
this.trend = new ThingRendable( 90, 32, 7.5f );
this.trend.Material = (Material)MaterialManager.Instance.GetByName( "Examples/VTDarkStuff" );
this.trend.Material.Load();
this.snode.AttachObject( this.trend );
this.fnode = SceneManager.RootSceneNode.CreateChildSceneNode();
Entity head = SceneManager.CreateEntity( "head", "ogrehead.mesh" );
this.fnode.AttachObject( head );
Animation anim = SceneManager.CreateAnimation( "OgreTrack", 10 );
anim.InterpolationMode = InterpolationMode.Spline;
NodeAnimationTrack track = anim.CreateNodeTrack( 0, this.fnode );
TransformKeyFrame key = track.CreateNodeKeyFrame( 0 );
key.Translate = new Vector3( 0, -15, 0 );
key = track.CreateNodeKeyFrame( 5 );
key.Translate = new Vector3( 0, 15, 0 );
key = track.CreateNodeKeyFrame( 10 );
key.Translate = new Vector3( 0, -15, 0 );
this.animState = SceneManager.CreateAnimationState( "OgreTrack" );
this.animState.IsEnabled = true;
this.globalReal = 0.4f;
this.globalImag = 0.6f;
this.globalTheta = 0.0f;
CreateControls();
DragLook = true;
Generate();
}
示例8: ManagerContainsNode
private static bool ManagerContainsNode( SceneManager sceneManager, SceneNode childNode )
{
bool managerContainsChild = false;
foreach ( SceneNode sceneNode in sceneManager.SceneNodes )
{
if ( sceneNode.Equals( childNode ) )
{
managerContainsChild = true;
}
}
return managerContainsChild;
}
示例9: Boundary
public Boundary(String name)
{
points = new List<Vector2>();
semantics = new List<IBoundarySemantic>();
touchedPages = new List<PageCoord>();
this.name = name;
sceneNode = parentSceneNode.CreateChildSceneNode(name);
pageSize = TerrainManager.Instance.PageSize;
}
示例10: WaterPlane
public WaterPlane(SceneNode parentSceneNode, XmlTextReader r)
{
FromXML(r);
// create a scene node
if (parentSceneNode == null)
{
parentSceneNode = TerrainManager.Instance.RootSceneNode;
}
waterSceneNode = parentSceneNode.CreateChildSceneNode(name);
// set up material
material = TerrainManager.Instance.WaterMaterial;
}
示例11: CreateScene
protected override void CreateScene()
{
// set some ambient light
scene.AmbientLight = ColorEx.Gray;
// create an entity to have follow the path
Entity ogreHead = scene.CreateEntity("OgreHead", "ogrehead.mesh");
// create a scene node for the entity and attach the entity
SceneNode headNode = scene.RootSceneNode.CreateChildSceneNode();
headNode.AttachObject(ogreHead);
// // create a cool glowing green particle system
// ParticleSystem greenyNimbus = ParticleSystemManager.Instance.CreateSystem("GreenyNimbus", "ParticleSystems/GreenyNimbus");
// scene.RootSceneNode.CreateChildSceneNode().AttachObject(greenyNimbus);
ParticleSystem fireworks = ParticleSystemManager.Instance.CreateSystem("Fireworks", "Examples/Fireworks");
scene.RootSceneNode.CreateChildSceneNode().AttachObject(fireworks);
// shared node for the 2 fountains
fountainNode = scene.RootSceneNode.CreateChildSceneNode();
// create the first fountain
ParticleSystem fountain1 = ParticleSystemManager.Instance.CreateSystem("Fountain1", "Examples/PurpleFountain");
SceneNode node = fountainNode.CreateChildSceneNode();
node.Translate(new Vector3(200, -100, 0));
node.Rotate(Vector3.UnitZ, 20);
node.AttachObject(fountain1);
// create the second fountain
ParticleSystem fountain2 = ParticleSystemManager.Instance.CreateSystem("Fountain2", "Examples/PurpleFountain");
node = fountainNode.CreateChildSceneNode();
node.Translate(new Vector3(-200, -100, 0));
node.Rotate(Vector3.UnitZ, -20);
node.AttachObject(fountain2);
// create a rainstorm
ParticleSystem rain = ParticleSystemManager.Instance.CreateSystem("Rain", "Examples/Rain");
scene.RootSceneNode.CreateChildSceneNode(new Vector3(0, 1000, 0), Quaternion.Identity).AttachObject(rain);
rain.FastForward(5.0f);
// Aureola around Ogre perpendicular to the ground
ParticleSystem pSys5 = ParticleSystemManager.Instance.CreateSystem("Aureola",
"Examples/Aureola");
scene.RootSceneNode.CreateChildSceneNode().AttachObject(pSys5);
// Set nonvisible timeout
ParticleSystem.DefaultNonVisibleUpdateTimeout = 5;
}
示例12: CreateScene
public override void CreateScene()
{
// set some ambient light
scene.AmbientLight = new ColorEx( 1.0f, 0.2f, 0.2f, 0.2f );
// create a skydome
scene.SetSkyDome( true, "Examples/CloudySky", 5, 8 );
// create a simple default point light
Light light = scene.CreateLight( "MainLight" );
light.Position = new Vector3( 20, 80, 50 );
// create a plane for the plane mesh
Plane plane = new Plane();
plane.Normal = Vector3.UnitY;
plane.D = 200;
// create a plane mesh
MeshManager.Instance.CreatePlane( "FloorPlane", ResourceGroupManager.DefaultResourceGroupName, plane, 200000, 200000, 20, 20, true, 1, 50, 50, Vector3.UnitZ );
// create an entity to reference this mesh
Entity planeEntity = scene.CreateEntity( "Floor", "FloorPlane" );
planeEntity.MaterialName = "Examples/RustySteel";
scene.RootSceneNode.CreateChildSceneNode().AttachObject( planeEntity );
// create an entity to have follow the path
Entity ogreHead = scene.CreateEntity( "OgreHead", "ogrehead.mesh" );
// create a scene node for the entity and attach the entity
headNode = scene.RootSceneNode.CreateChildSceneNode( "OgreHeadNode", Vector3.Zero, Quaternion.Identity );
headNode.AttachObject( ogreHead );
// make sure the camera tracks this node
camera.SetAutoTracking( true, headNode, Vector3.Zero );
// create a scene node to attach the camera to
SceneNode cameraNode = scene.RootSceneNode.CreateChildSceneNode( "CameraNode" );
cameraNode.AttachObject( camera );
// turn on some fog
scene.SetFog( FogMode.Exp, ColorEx.White, 0.0002f );
}
示例13: CreateScene
public override void CreateScene()
{
scene.AmbientLight = new ColorEx( .4f, .4f, .4f );
Light light = scene.CreateLight( "MainLight" );
light.Position = new Vector3( 50, 80, 0 );
Entity head = scene.CreateEntity( "OgreHead", "ogrehead.mesh" );
entityList.Add( head );
scene.RootSceneNode.CreateChildSceneNode().AttachObject( head );
Entity box = scene.CreateEntity( "Box1", "cube.mesh" );
entityList.Add( box );
scene.RootSceneNode.CreateChildSceneNode( new Vector3( -100, 0, 0 ), Quaternion.Identity ).AttachObject( box );
box = scene.CreateEntity( "Box2", "cube.mesh" );
entityList.Add( box );
scene.RootSceneNode.CreateChildSceneNode( new Vector3( 100, 0, -300 ), Quaternion.Identity ).AttachObject( box );
box = scene.CreateEntity( "Box3", "cube.mesh" );
entityList.Add( box );
scene.RootSceneNode.CreateChildSceneNode( new Vector3( -200, 100, -200 ), Quaternion.Identity ).AttachObject( box );
frustum = new Frustum( "PlayFrustum" );
frustum.Near = 10;
frustum.Far = 300;
// create a node for the frustum and attach it
frustumNode = scene.RootSceneNode.CreateChildSceneNode( new Vector3( 0, 0, 200 ), Quaternion.Identity );
// set the camera in a convenient position
camera.Position = new Vector3( 0, 759, 680 );
camera.LookAt( Vector3.Zero );
frustumNode.AttachObject( frustum );
frustumNode.AttachObject( camera2 );
}
示例14: RestoreRootSceneNode
public void RestoreRootSceneNode()
{
this.rootSceneNode = this.defaultRootNode;
}
示例15: OverrideRootSceneNode
/// <summary>
/// If set, only the selected node is rendered.
/// To render all nodes, set to null.
/// </summary>
///
public void OverrideRootSceneNode( SceneNode node )
{
this.rootSceneNode = node;
}