本文整理汇总了C#中Scene类的典型用法代码示例。如果您正苦于以下问题:C# Scene类的具体用法?C# Scene怎么用?C# Scene使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Scene类属于命名空间,在下文中一共展示了Scene类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public static void Run()
{
// ExStart:Save3DScene
// The path to the documents directory.
string MyDir = RunExamples.GetDataDir();
// Load a 3D document into Aspose.3D
Scene scene = new Scene();
// Open an existing 3D scene
scene.Open(MyDir + "document.fbx");
// Save Scene to a stream
MemoryStream dstStream = new MemoryStream();
scene.Save(dstStream, FileFormat.FBX7500ASCII);
// Rewind the stream position back to zero so it is ready for next reader.
dstStream.Position = 0;
// Save Scene to a local path
scene.Save(MyDir + "output_out.fbx", FileFormat.FBX7500ASCII);
// ExEnd:Save3DScene
Console.WriteLine("\nConverted 3D document to stream successfully.");
}
示例2: OnLevelActivate
/// <summary>
/// Recieve Event to change the current level portal's state. This will have a transition cause the player is present.
/// </summary>
/// <param name="scene"></param>
/// <param name="state"></param>
void OnLevelActivate(Scene scene, State state)
{
if (scene == sceneToLoad)
{
switch (state)
{
case State.Undefined:
break;
case State.InActive:
mesh.renderer.material.mainTexture = _defaultTexture;
//gameObject.renderer.material.color = Color.red;
iTween.Stop(gameObject);
isActive = false;
break;
case State.Active:
mesh.renderer.material.mainTexture = _activeTexture;
iTween.ShakePosition(gameObject, iTween.Hash("amount", Vector3.forward/4f, "time", .5f, "looptype", iTween.LoopType.loop));
iTween.ShakeRotation(gameObject, iTween.Hash("z", 5f, "time", .5f, "looptype", iTween.LoopType.loop));
isActive = true;
break;
default:
throw new NotImplementedException();
}
}
}
示例3: Run
public static void Run()
{
// Initialize scene object
Scene scene = new Scene();
// Initialize Node class object
Node cubeNode = new Node("cube");
// Call Common class create mesh method to set mesh instance
Mesh mesh = Common.CreateMesh();
// Point node to the Mesh geometry
cubeNode.Entity = mesh;
// Set rotation
cubeNode.Transform.Rotation = Quaternion.FromRotation(new Vector3(0, 1, 0), new Vector3(0.3, 0.5, 0.1));
// Set translation
cubeNode.Transform.Translation = new Vector3(0, 0, 20);
// Add cube to the scene
scene.RootNode.ChildNodes.Add(cubeNode);
// The path to the documents directory.
string MyDir = RunExamples.GetDataDir_GeometryAndHierarchy();
MyDir = MyDir + "TransformationToNode.fbx";
// Save 3D scene in the supported file formats
scene.Save(MyDir, FileFormat.FBX7400ASCII);
Console.WriteLine("\nTransformation added successfully to node.\nFile saved at " + MyDir);
}
示例4: Run
public static void Run()
{
// ExStart:AddAssetInformationToScene
// Initialize a 3D scene
Scene scene = new Scene();
// Set application/tool name
scene.AssetInfo.ApplicationName = "Egypt";
// Set application/tool vendor name
scene.AssetInfo.ApplicationVendor = "Manualdesk";
// We use ancient egyption measurement unit Pole
scene.AssetInfo.UnitName = "pole";
// One Pole equals to 60cm
scene.AssetInfo.UnitScaleFactor = 0.6;
// The path to the documents directory.
string MyDir = RunExamples.GetDataDir();
MyDir = MyDir + RunExamples.GetOutputFilePath("InformationToScene.fbx");
// Save scene to 3D supported file formats
scene.Save(MyDir, FileFormat.FBX7500ASCII);
// ExEnd:AddAssetInformationToScene
Console.WriteLine("\nAsset information added successfully to Scene.\nFile saved at " + MyDir);
}
示例5: fixTrajectory
/**
* Invokes all possible checks for the trajectory
* @param scene
*/
public static void fixTrajectory(Scene scene)
{
fixSingleNode(scene);
fixDuplicateNodes(scene);
fixMissingNodes(scene);
fixNodesWithSameLocation(scene);
}
示例6: GameAction
/// <summary>
/// Initializes a new instance of the <see cref="GameAction" /> class.
/// </summary>
/// <param name="name">Name of the game action.</param>
/// <param name="scene">The scene</param>
protected GameAction(string name, Scene scene = null)
{
this.IsSkippable = true;
this.State = TaskState.None;
this.Name = name;
this.Scene = scene;
}
示例7: SceneComponent
public SceneComponent(Scene aScene)
{
mScene = aScene;
// Add Events
AddEventListeners();
}
示例8: LoadContent
protected override async Task LoadContent()
{
await base.LoadContent();
graphicsCompositor = new SceneGraphicsCompositorLayers
{
Cameras = { Camera.Get<CameraComponent>() },
Master =
{
Renderers =
{
new ClearRenderFrameRenderer { Color = Color.Green, Name = "Clear frame" },
new SceneDelegateRenderer(PreCameraRendererDraw),
new SceneCameraRenderer { Mode = SceneCameraRenderer },
new SceneDelegateRenderer(PostCameraRendererDraw),
}
}
};
Scene = new Scene { Settings = { GraphicsCompositor = graphicsCompositor } };
Scene.AddChild(Camera);
var ambientLight = new Entity { new LightComponent { Type = new LightAmbient { Color = new LightColorRgb(Color.White) }, Intensity = 1 } };
Scene.AddChild(ambientLight);
SceneSystem.SceneInstance = new SceneInstance(Services, Scene);
}
示例9: Audio3Dupdate
static WaveBank mPermWaveBank; // one permanant wave bank
#endregion Fields
#region Methods
public static void Audio3Dupdate(Scene scene)
{
Audio3DCue c;
if (mActiveCueList != null)
{
setListener(scene);
for (int i = 0; i < mActiveCueList.Count; i++)
{
c = mActiveCueList[i];
if (c.cue.IsDisposed)
{
mCueStack.Push(c);
mActiveCueList.RemoveAt(i);
}
else if (!c.cue.IsDisposed && c.cue.IsStopped)
{
c.cue.Dispose();
mCueStack.Push(c);
mActiveCueList.RemoveAt(i);
}
else
apply3Daudio(c);
}
}
}
示例10: CreateScene
protected override Scene CreateScene()
{
var scene = new Scene("MainScene");
scene.Add(new ColorLayer("Background", Color.CornflowerBlue));
var spriteSheet = this.CreateSpriteSheet();
this.entityLayer = new SpriteLayer("EntityMap");
scene.Add(this.entityLayer);
this.playerShipEntity = new PlayerShipEntity(this.entityLayer, spriteSheet);
this.playerShipEntity.BindController(this.InputConfiguration);
scene.Add(this.playerShipEntity);
var yellowSprite = new Sprite(spriteSheet, "YellowEnemy") { Position = new Vector(250, 100) };
var redSprite = new Sprite(spriteSheet, "RedEnemy") { Position = new Vector(300, 100) };
var blueSprite = new Sprite(spriteSheet, "BlueEnemy") { Position = new Vector(350, 100) };
this.entityLayer.AddSprite(yellowSprite);
this.entityLayer.AddSprite(redSprite);
this.entityLayer.AddSprite(blueSprite);
return scene;
}
示例11: createScene
private static void createScene()
{
XmlSerializer sceneSer = new XmlSerializer(typeof(Scene));
try
{
using (FileStream xmlStream = File.OpenRead(Constants.SCENE))
{
layout = (Scene)sceneSer.Deserialize(xmlStream);
}
}
catch (Exception e)
{
Console.WriteLine(e);
return;
}
foreach (SphereMaterial mat in layout.Spheres)
{
layout.Shapes.Add(new Sphere(mat));
}
foreach (PlaneMaterial mat in layout.Planes)
{
layout.Shapes.Add(new Plane(mat, Constants.FLOOR_SHADING));
}
layout.Cam.setup();
}
示例12: BeginTransitionOn
protected override void BeginTransitionOn()
{
spriteBatch = new SpriteBatch(device);
font = content.Load<SpriteFont>("Consolas");
scene = new Scene(kernel);
var camera = new EntityDescription(kernel);
camera.AddProperty(new TypedName<Camera>("camera"));
camera.AddProperty(new TypedName<Viewport>("viewport"));
camera.AddBehaviour<View>();
var cameraEntity = camera.Create();
cameraEntity.GetProperty(new TypedName<Camera>("camera")).Value = new Camera();
cameraEntity.GetProperty(new TypedName<Viewport>("viewport")).Value = new Viewport() { Height = 1920, Width = 1080 };
scene.Add(camera.Create());
var renderer = scene.GetService<Renderer>();
renderer.StartPlan()
.Then<A>()
.Then<B>()
.Then<C>()
.Then<D>()
.Apply();
base.OnShown();
}
示例13: Form1
public Form1()
{
InitializeComponent();
_openGLControl.InitializeContexts();
_openGLControl.SizeChanged += new EventHandler(OnOpenGLControlResized);
_input.Mouse = new Mouse(this, _openGLControl);
_input.Keyboard = new Keyboard(_openGLControl);
_scene = new Scene();
InitializeDisplay();
// InitializeSounds();
InitializeTextures();
// InitializeFonts();
InitializeGameState();
_layers = new Layers(_scene, _textureManager);
_layers.Show();
_modeComboBox.SelectedIndex = 1;
_fastLoop = new FastLoop(GameLoop);
}
示例14: getEquipMarkerNode
public MarkerNode getEquipMarkerNode(Scene scene)
{
int[] ids = new int[1];
ids[0] = 1;
//return new MarkerNode(scene.MarkerTracker, "Equipment.txt", ids); //ids[1]);
return new MarkerNode(scene.MarkerTracker, "EquipementMarkerConfig.txt", ids); //ids[1]);
}
示例15: OnLevelActivate
void OnLevelActivate(Scene scene, State state)
{
if (scene == Scene.Hub && state == State.Active)
{
StartCoroutine(StartGameTransition());
}
}