Click Here to Install Silverlight*
IndiaChange|All Microsoft Sites
Microsoft
Communities 
 
Chat Transcript
 
Chat Topic : 3D in Windows Presentation Foundation
Chat Expert : Mahesh
November 16, 2005
 
 

Subhashini  (Moderator): Hi all, Welcome to today's webchat on 3D Windows Presentation Foundation

Subhashini  (Moderator): We have with us today Mahesh Mitkari ( UG lead of Pune User Group ) as the expert of the chat today

Subhashini  (Moderator): On account of power outage unfortunately , Mahesh has been unable to use his computer and logon to the chat tool. So he does not appear in the experts , but rather appears in the guest list . He's hosting this chat from Sify 

Subhashini  (Moderator): Let’s welcome his spirit and to give a short introduction about him in his own words :

Mahesh Mitkari

I am the UG Leader for Pune User Group, Manager for PuneITPro, INETA volunteer and handling INETA book review program in pune.

I am the Founder of Teknotika solutions and working as a .net consultant under banner of Teknotika solutions (http://www.teknotika.com/) I have a sound knowledge of designing and developing applications using NET framework. And am also interested in working on mobile development.

Working in Microsoft technology from Visual basic 6.0 and now in .NET

Also worked in various languages like VB, Java, .NET, PHP, C/C++, etc… and platforms like DOS, Windows, and Linux.

You can reach me at m_mahesh@msn.com

 

[Expert] Mahesh: Hello there a very good evening to all...

[Expert] Mahesh: Last month, we had a chat session at Introduction to Avalon, by Dhaval Faria  this chat session is continuing to it.

[Expert] Mahesh: Today we will discuss about 3D Support in Avalon, but before we start… let us take a look at Avalon in a quick manner.

[Expert] Mahesh: Avalon name has been changed to Windows Presentation Foundation (WPF).

[Expert] Mahesh: Windows Presentation Foundation is a new layer for a Windows, which enables developers to create a killer UI application very quickly using XAML as a language.

[Expert] Mahesh: WPF is built on top of DirectX, and it utilizes power of WPF to generate 2D as well as 3D UI.

[Expert] Mahesh: Now let us discuss on 3D support in WPF.

[Expert] Mahesh: Earlier to develop 3D user interface or 3D Object in Application, it’s very difficult to do. Now days we can make use of DirectX or OpenGL to do it, but again it is not an easy task to do, developer needs to understand how display adapter works,

[Expert] Mahesh: and many other things even for a normal 3D or 2D Application.

[Expert] Mahesh: After release of WPF things will get pretty easy, you can do 3D apps and 2D apps without the need of understanding how display adapter works.

[Expert] Mahesh: hey friends you can ask me questions any time or also at the end of this chat

[Expert] Mahesh: just one thing to keep in mind is, you can develop 3D Games with Avalon pretty quick but not powerful games like Age of Empires, Quake 3, Doom, or any other 3D Games which takes a whole lot of resource, to develop this kind of game, you again needs to use Di

[Expert] Mahesh: DirectX or OpenGL.

[Expert] Mahesh: so far there is nothing which is going to replace DirectX Direct3D.

[Expert] Mahesh: Any time we do any UI thing, almost everything we do is concentrated in doing 2D graphics in new ways.

Venkat_KL: Shall I Ask You One dummy question!! Can we make Application which gives real 3D Effect like Chota Chetan Film

[Expert] Mahesh: yes but may be in final release of WPF

[Expert] Mahesh: that comes under the media part of WPF

[Expert] Mahesh: continue to my previous part ....

[Expert] Mahesh: But we are really fascinated about 3D Graphics, 3D Support in Avalon will fall in to two categories: 3D in Application/Page and 3D on Desktop.

[Expert] Mahesh: 3D in application/page will be for general programmers, to do a little 3D UI and have it integrated with 2D UI, and also you can load XAML code in IE browser

[Expert] Mahesh: and  download from internet, and it will render the XAML code and show in browser, provided WPF runtimes are installed on the user’s machine.

[Expert] Mahesh: 3D in desktop will be used to show Windows in new and interesting ways.

[Expert] Mahesh: Computer screens are 2D in nature, so representing 3D scenes gives some trouble, but Avalon takes care of the same.

[Expert] Mahesh: In order to display anything on the screen, in 2D or 3D, Avalon needs to know

[Expert] Mahesh: what are the things to be displayed, whether it’s a ellipse, text or rectangle, and it also requires details like size, position, color. 

[Expert] Mahesh: This all information are enough for 2D, but 3D requires a lot more information, like three co-ordinates, X Y Z also it requires point of view – from where u looking at the object.

[Expert] Mahesh: The items in 3D world are referred as Models and point of view is called Camera, this both are properties of element ViewPort3D.

[Expert] Mahesh: ViewPort3D is the Avalon element, which is used to put 3D content to your application. ViewPort3D sits at the boundary between 2D and 3D world.

[Expert] Mahesh: If we look from the Avalon Engine Perspective, ViewPort3D is no different from any other visual element, it is treated as 2D entity with 2D position, width and height, and it can be rotated and scaled like any other content.

[Expert] Mahesh: ViewPort3D acts as a window onto isolated 3D World, but from outside it behaves like any other 2D Avalon Element, but in its inside we find all 3D things and point of view settings.

[Expert] Mahesh: Camera acts as a point of view, and depending on the position and orientation of camera Avalon decides how ur object should look like form that position and object.

[Expert] Mahesh: let me show you some code...

[Expert] Mahesh:

<ViewPort3D ID="viewport" ClipToBounds="true" Width="100" Height="100">

<ViewPort3D.Camera>

<PerspectiveCamera NearPlaneDistance="1" FarPlaneDistance="100" Position="0,0,5" LookAtPoint="0,0,0" Up="0, 1, 0" FieldOfView="45" />

</ViewPort3D.Camera>

</ViewPort3D>

 

Venkat_KL: Can you give some URL / Code Sample where I Can change the shape of the Command Button in the Present version of .net ie 1.1 (vb.net or c# -  Windows Application)

[Expert] Mahesh: for Avalon you need Framework 2.0

[Expert] Mahesh: okt this code is not answer to your question this is part of my talk

Venkat_KL: In the End you can give. sorry to ask in-between

[Expert] Mahesh: I will check and give the exact URL at end

Venkat_KL: continue with your thing, sorry

[Expert] Mahesh: its ok you can ask question in Between on WPF

[Expert] Mahesh: ok so..

[Expert] Mahesh: above code shows camera in ViewPort3D, there are lots of camera views available depending on the projection required.

[Expert] Mahesh: Avalon supports two types of projection, PerspectiveCamera and OrthographicCamera, there is also MatrixCamera which allows projection to be directly specified in 4x4 matrix, which allows application to perform transformations on the camera position and angle

[Expert] Mahesh: Perspective projection produces natural-looking images than a orthographic projection. It does this by making objects in the distance appear smaller than nearby Models. We can also see depth of models

[Expert] Mahesh: Orthographic Projection is very simpler projection, it removes one dimension, flattering everything into plane, while leaving other dimensions untouched.

[Expert] Mahesh: The unique benefit of the Orthographic project is that it preserves the relative sizes of the models, which means objects do not get smaller the further away they are from the point of view (camera).

[Expert] Mahesh: These types of projection are very useful in bar charts and certain kind of visualization.

[Expert] Mahesh: Camera and ViewPort3D must contain a Model, which is a collection of 3D objects, each object must derive from the Model3D class.  There is only one primitive available in Model3D which is MeshPrimitive3D.

[Expert] Mahesh: MeshPrimitive3D lets you create a mesh, very flexible primitive that is the foundation of most modern 3D rendering systems.

[Expert] Mahesh: Meshes lets you define the shape of 3D models using lots of triangles. But its not convenient way to create shapes. We do have shapes which has curves. But there is a good reason for using triangles, graphics cards are really good at triangles,

[Expert] Mahesh: they can render millions of triangles in a second. 3D programs like 3D Max, Maya are really good at building all sorts of interesting shapes from triangles.

[Expert] Mahesh:

<MeshPrimitive3D>

<MeshPrimitive3D.Mesh>

<Mesh3D TriangleIndices="0 1 2 1 2 3 2 3 0 0 1 3" Normals="-1,-1,0 1,-1,0 1,0,0 0,0,1" Positions="-2,-2,-2 2,-2,-2 0,2,-2 0,0,3"/>

</MeshPrimitive3D.Mesh>

<MeshPrimitive3D.Material>

<BrushMaterial Brush="Blue" />

</MeshPrimitive3D.Material>

</MeshPrimitive3D>

 

[Expert] Mahesh: we are short of time we will see some code of MeshPritive and then we will start with questions

[Expert] Mahesh: The TriangleIndices attribute contains a list of numbers grouped in threes. First set is 0 1 2, meaning that the first triangle in this mesh uses the first second and third co-ordinates in the positions list.

[Expert] Mahesh: The Normals attribute is used in lighting calculations.

Kaushalendra: Can you give us some code of sample programming of 3D.

 [Expert] Mahesh: it is difficult to post the code here ,so please send me a mail to m_mahesh@msn.com  i will mail you

[Expert] Mahesh: thank you for your suggestion we will try to implement that in feature

[Expert] Mahesh: hey Venkat ! you were asking about the 3D movie like chhota chetan ? so as per my information now we can't make that with avalon since avalon is based on DirectX and this is for presentation. It can’t be done... Because WPF is designed to present ui

Venkat_KL: can you give me the url or code for making the command button round in the .net 1.1 please

[Expert] Mahesh: and not core 3d graphics. U can still try to do, but wont get realistic effect.

[Expert] Mahesh: you can do that by using masking n transparency key

[Expert] Mahesh: Today we will end up here, we will take a look at the more advance 3D support in WPF in a later chat sessions, which will cover Materials, Lights, Cameras more in depth and also we will look at few code samples.

[Expert] Mahesh: you can ask the questions now or mail me at m_mahesh@msn.com

[Expert] Mahesh: is there any question ?

Venkat_KL: I wanted the code / url for the present command button

Subhashini  (Moderator): Great ! So the space is open for questions . Please use the checkbox " Ask the experts" to ask your queries

Subhashini  (Moderator): we will extend the chat to another 15 minutes

[Expert] Mahesh: OK all if you do not have any questions you can read more about 3D at http://msdn.microsoft.com/winfx/building/presentation/default.aspx 

Windows_server2003: Alright. When to see event with "ISA 2004" or  other topics in PUG meeting ?

[Expert] Mahesh: search for 3D avalon or WPF there

Venkat_KL: I did not get the ans

[Expert] Mahesh: for what ?

[Expert] Mahesh: could you please repeat question

Subhashini  (Moderator): Guess we don’t have any questions

Venkat_KL: making the command button elliptical or round

Venkat_KL: in winforms .net 1.1

[Expert] Mahesh: you can do that using masking n transparency key

Venkat_KL: code snippet is there

Venkat_KL: or even url will do

[Expert] Mahesh: please mail me I will mail you the code or URL right now i don't remember that URL

Subhashini  (Moderator): This brings us to the closure of the chat for today !

Venkat_KL: ok thanks

[Expert] Mahesh: thank you all for joining please mail your questions to  m_mahesh@msn.com  or dhaval.faria@ineta.org 

Subhashini  (Moderator): Please feel free to email your queries to Mahesh

Subhashini  (Moderator): Thanks to all of you for joining this chat and hope you found the chat useful and informative

Subhashini  (Moderator): Thanks to Mahesh for an information packed session

Subhashini  (Moderator): The chat transcript will be posted live and feel free to pool in your feedback at commind@microsoft.com

Subhashini  (Moderator): Thanks again and have a lovely evening !

 
     

©2009 Microsoft Corporation. All rights reserved. Contact Us |Terms of Use |Trademarks |Privacy Statement