osgDotNet-x86-2.0.0-0.8.1

所属分类:3D图形编程
开发工具:C#
文件大小:3816KB
下载次数:231
上传日期:2011-10-11 11:28:26
上 传 者dangfadi
说明:  osgsdk 在C#下的开发环境 osg 2.0
(osg C# development environment. . . . . . . . . . . . . . . . . . . . . . . . . .)

文件列表:
osgDotNet (0, 2007-06-29)
osgDotNet\LICENSE.txt (187, 2007-06-29)
osgDotNet\Osg.NET.dll (5836800, 2007-06-29)
osgDotNet\OsgDB.NET.dll (1208320, 2007-06-29)
osgDotNet\OsgFX.NET.dll (974848, 2007-06-29)
osgDotNet\OsgGA.NET.dll (1355776, 2007-06-29)
osgDotNet\OsgManipulator.NET.dll (1810432, 2007-06-29)
osgDotNet\OsgParticle.NET.dll (1826816, 2007-06-29)
osgDotNet\OsgShadow.NET.dll (962560, 2007-06-29)
osgDotNet\OsgSim.NET.dll (1581056, 2007-06-29)
osgDotNet\OsgTerrain.NET.dll (1081344, 2007-06-29)
osgDotNet\OsgText.NET.dll (917504, 2007-06-29)
osgDotNet\OsgUtil.NET.dll (2322432, 2007-06-29)
osgDotNet\OsgViewer.NET.dll (1273856, 2007-06-29)

Please see http://www.openscenegraph.com/projects/osgDotNet for the latest information and documentation on the osgDotNet wrappers. Getting Started with the osgDotNet Wrappers ------------------------------------------- Download and Setup ~~~~~~~~~~~~~~~~~~ Download the osgDotNet binary wrapper assemblies, or the osgDotNet code generator and build your own assemblies. Copy the assemblies to a directory on your disk. PLEASE NOTE: the osgDotNet assemblies REQUIRE the OpenSceneGraph DLLs to run, but these DLLs ARE NOT INCLUDED in the osgDotNet packages. You will need to either download the pre-built OpenSceneGraph Win32 binaries, or build them yourself manually. C# Project Setup ~~~~~~~~~~~~~~~~ 1. Create or open a C# project in Visual Studio 2005. 2. Add an x86 or x*** platform configuration to your C# project via Build > Configuration Manager... and make that the active platform. 3. In the C# project, add references to the the osgDotNet wrapper assemblies you will be using by browsing to the directory where you copied them. 4. Copy the OpenSceneGraph (i.e. native, non-wrapper) Release DLLs for the OSG libraries and plugins you will be using as well as all of their dependency DLLs to the directory containing the C# executable. Wrapper assembly DLLs will get copied automatically via the project reference configuration and do not need to be copied manually. Viewer Setup ~~~~~~~~~~~~ The following code can be used to test the setup/configuration by rendering a simple scene consisting of a lit colored quad. Note the use of the using statement -- this ensures that the viewer is created and destroyed in the same thread which is required by Win32. class Program { static void Main(string[] args) { using (OsgViewer.Viewer viewer = new OsgViewer.Viewer()) { Osg.Geode geode = new Osg.Geode(); Osg.Geometry geometry = new Osg.Geometry(); Osg.Vec3Array vertices = new Osg.Vec3Array(); Osg.Vec3Array normals = new Osg.Vec3Array(); Osg.Vec3Array colors = new Osg.Vec3Array(); Osg.DrawArrays drawArrays = new Osg.DrawArrays((uint)Osg.DrawArrays.Mode.QUADS, 0, 4); vertices.Add(new Osg.Vec3(-1.0f, 0.0f, -1.0f)); vertices.Add(new Osg.Vec3(1.0f, 0.0f, -1.0f)); vertices.Add(new Osg.Vec3(1.0f, 0.0f, 1.0f)); vertices.Add(new Osg.Vec3(-1.0f, 0.0f, 1.0f)); normals.Add(new Osg.Vec3(0.0f, -1.0f, 0.0f)); normals.Add(new Osg.Vec3(0.0f, -1.0f, 0.0f)); normals.Add(new Osg.Vec3(0.0f, -1.0f, 0.0f)); normals.Add(new Osg.Vec3(0.0f, -1.0f, 0.0f)); colors.Add(new Osg.Vec3(1.0f, 0.0f, 0.0f)); colors.Add(new Osg.Vec3(0.0f, 1.0f, 0.0f)); colors.Add(new Osg.Vec3(0.0f, 0.0f, 1.0f)); colors.Add(new Osg.Vec3(1.0f, 1.0f, 0.0f)); geometry.addPrimitiveSet(drawArrays); geometry.setVertexArray(vertices); geometry.setNormalArray(normals); geometry.setNormalBinding(Osg.Geometry.AttributeBinding.BIND_PER_VERTEX); geometry.setColorArray(colors); geometry.setColorBinding(Osg.Geometry.AttributeBinding.BIND_PER_VERTEX); geode.addDrawable(geometry); viewer.setSceneData(geode); viewer.run(); } } } Developing Against the osgDotNet Wrappers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For the most part the osgDotNet wrappers maintain fidelity to the OpenSceneGraph C++ API; its documentation, in conjunction with Intellisense, should be used as a guide to the interfaces. Extension of the interfaces via subclassing is also supported. However, some differences between the two were either desirable or unavoidable. The main DifferencesWithNativeAPI relate to divergence in namespace names, reference/value semantics, enum usage, protected and operator functions, public member access, and divergence to support more idiomatic CLR usage.

近期下载者

相关文件


收藏者