Giter Site home page Giter Site logo

salmakis / dotwarp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tgjones/dotwarp

0.0 1.0 0.0 15.66 MB

DotWarp is an easy-to-use 3D software rasterization library, which produces 2D rendered images from 3D mesh files. It uses WARP, a 3D software rasterizer built-in to Windows Vista / 7 / Server 2008 R2, for the actual rasterization. It is a .NET 4.0 project.

Home Page: http://timjones.tw/blog/archive/2011/02/23/dotwarp---server-side-d-renderer-for

License: Other

C# 100.00%

dotwarp's Introduction

DotWarp

What is this?

DotWarp is an easy-to-use 3D software rasterization library, which produces 2D rendered images from 3D mesh files. It uses WARP, a 3D software rasterizer built-in to Windows Vista / 7 / 8 / Server 2008 R2 / Server 2012, for the actual rasterization. It is a .NET 4.0 project.

For more information about WARP, see http://msdn.microsoft.com/en-us/library/gg615082.aspx.

System requirements

DotWarp has some fairly specific requirements / prerequisites:

  1. .NET 4.0
  2. Windows Vista / 7 / 8 / Server 2008 R2 / Server 2012 (WARP is only supported on these platforms)
  3. Latest DirectX End-User Runtime

Quick start

  1. Install DotWarp using NuGet.
  2. Read the wiki for information on using DotWarp to render 3D scenes.

Why should I use DotWarp?

  • You want to render 3D images in a server-side environment (such as ASP.NET).

How to use DotWarp

DotWarp relies on Meshellator to import meshes from 3D files (currently, Meshellator only supports .obj and .3ds files). Materials are loaded from the mesh files, and default lighting is used.

Scene scene = MeshellatorLoader.ImportFromFile("Models/3ds/85-nissan-fairlady.3ds");
using (WarpSceneRenderer renderer = new WarpSceneRenderer(scene, 800, 600))
{
	renderer.Initialize();

	Camera camera = new PerspectiveCamera
	{
		FarPlaneDistance = 100000,
		NearPlaneDistance = 1,
		FieldOfView = MathUtility.PI_OVER_4,
		LookDirection = new Vector3D(-1, -0.3f, 1),
		Position = new Point3D(3000, 1500, -1500),
		UpDirection = Vector3D.Up
	};

	BitmapSource bitmap = renderer.Render(camera);

	// Can save bitmap, or do something else with it.
	PngBitmapEncoder e = new PngBitmapEncoder();
	e.Frames.Add(BitmapFrame.Create(bitmap));
	using (Stream stream = File.OpenWrite("output.png"))
		e.Save(stream);
}

This renders the following image:

rendered image

dotwarp's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.