수안이의 컴퓨터 연구실

  • Mainpage
  • About Me
  • Tags
  • Metapage
  • Notice
  • Location
  • Keywords
  • Guestbook
  • Admin
  • Write an Article
  • Total | 1694379
  • Today | 124
  • Yesterday | 606

3 Articles, Search for 'Web/Silverlight'

  1. 2007/07/10 SilverLight Introduction
  2. 2007/06/21 Silverlight Architecture Overview
  3. 2007/05/03 Microsoft Silverlight 1.1 Development Reference
«Prev  1  Next»
Web/Silverlight2007/07/10 10:38

SilverLight Introduction

출처 : http://www.codeproject.com/silverlight/silverlightintro.asp

3D Graphics in SilverLight

SilverLight Showing 3D Graphics (Rotating and Mouse-interactive) in Browser.

Introduction: What is SilverLight?

Alright, so you already heard a lot about SilverLight launch and that it is a Adobe Flash competitor etc. So I thought I would share some of my experiences with its early days. This article is a very basic introduction of what SilverLight is and shows one example of using 3D graphics in SilverLight.

So primarily Microsoft SilverLight is a development platform with the following key features:

  • Browser Plugin compatible with Mozilla Firefox, Apple Safari, Microsoft Internet Explorer, Opera
  • Supports ActiveX Wrapper Interfaces - so you can embed it in legacy applications

SilverLight Integrates with Browser

SilverLight Integrates with Browser. © suchit-tiwari.org

There are some more important features of SilverLight:

  • Incorporates Windows Presentation Foundation Core
  • Contains CLR (Common Language Runtime) and most important base classes from the .NET Framework
  • Supports programming in C#, VB, JScript, Ruby, Python
  • Embeds Communication Framework including WCF (Windows Communication Framework)
  • Comes with Data Framework including LINQ

In a nutshell, SilverLight can be modeled as a tetra-hedron with the following components.

SilverLight Tetra-hedron

SilverLight Tetra-hedron. © suchit-tiwari.org

For a more detailed component view, refer to the following pictorial overview of SilverLight. The MSDN site has a high resolution poster available.

SilverLight Developer Reference

SilverLight Developer Reference (Source: Microsoft MSDN Site)

What do you need to run this code?

You will need to install Microsoft SilverLight developer release from SilverLight Downloads.

  • Unzip the sources in a folder
  • Browse srtSilverLight.htm

3D Graphics Introduction

Now before we jump into explanation of the code, let's understand some basics of 3D graphics. The world in which we live is 3D. The computer screen in 2D. So when we have to visualize a 3D world on a 2D computer screen, we need to "take care" of the extra dimension. This "taking care" is called projection. The projections can be done using a Synthetic Camera Model.

In brief, the Synthetic Camera model assumes a virtual camera in a 3D world. The camera film is the computer screen. And whenever we take a picture using that camera, the picture on the film needs to be mapped onto the computer screen. The following figure shows this.

Synthetic Camera Model

Synthetic Camera Model. © suchit-tiwari.org

SilverLight provides a transformation matrix to achieve this camera modeling. The camera location is also called Point Of View (POV). Setting different POVs over a period of time can create beautiful animations. The film directors do that very nicely by swinging cameras over the cars and out of home windows. While you program this 3D world, it is pretty much like playing the director of the movie!

For a more detailed overview of Synthetic Camera Model, you can refer to this white paper.

Now let's understand how the 3D objects are represented in virtual world. There are many different ways of modeling 3D objects - polygonal, parametrics, procedural. These advanced topics are beyond the scope of this article. We will assume the polygonal modeling. Refer to the figure below.

3D Objects Representation

3D Objects Representation. © suchit-tiwari.org

The objects can be seen as made up of the vertices and their connecting edges that form the faces or polygons of the object. When we enter the code, you will understand how this modeling is done in SilverLight.

To understand 3D modeling theory, do the following:

  • Download eLearning Player
  • Save 3D Modeling Lecture on the local machine
  • Double click to Open/Play this local lecture

Code Explanation

Let's start with embedding SilverLight into your web page. Making this embedding cross-browser compatible is the crux of the starting step. This is simplified by reusing SilverLight.js script in the \js sub-folder. This file basically creates an HTML block for various browsers and creates the SilverLight object. Look for:

var AgControl = new ActiveXObject("AgControl.AgControl");

An XAML model is associated with this SilverLight object. This XAML file contains a shape definition for one ball object. This ball object is replicated for multiple instances.

File: srtSilverLight.htm
<body>
<div id="wpfe">
<div id="wpfeHost" class="host"> </div>
<script type="text/javascript">

Sys.Silverlight.createObjectEx(
{
source: 'assets/ball_n.xaml',
parentElement: document.getElementById("wpfeHost"),
id: 'wpfeBlock',
properties:
{
width:'500',
height:'500',
background:'white',
. . .
. . .

Once the SilverLight object is created, it is time to initialize the virtual world. Since the XAML model is associated with this scene, using JavaScript in SilverLight, you can extract individual XAML objects and create your JavaScript objects that are based on these XAML objects.

The following code creates the 4 balls around the Teta-hedron.

. . .
this._ballsO[0] = new WPFEBall(this._wpfeBlock, "wpfe_ball_0");

for (var i=1; i<this._N; i++)
this._ballsO[i] = this._ballsO[0].clone("wpfe_ball_" + i);
. . .

And the Teta-hedron is created using 3D modeling theory (with faces/polygons).

. . .
wall = new WPFEFace(this_._wpfeBlock, wpfeRoot,
[
[this.minx, 0, 0],
[this.maxx, 0, 0],
[(this.minx+this.maxx)/3, this.maxy*Math.tan(60*Math.PI/180)/3,
this.maxx*Math.tan(60*Math.PI/180)]
]
);
wall._elem.fill = "#99FF0000";
model.walls.shapes.push(wall);
. . .

The mathematics behind the tan(60), sin(6) etc is simple. It just calculates the lengths of the front and adjacent sides of the polygonal patches. Since Teta-hedron is based on an equilateral triangle, the angle of 60 appears in the code.

The mouse-drag-3D-rotate operation is standard JavaScript combined with POV.

function onMouseMove(sender, eventArgs)
{
if (!mouseData) return;
var pt = eventArgs.getPosition(null);
var dy = (pt.y - mouseData.e.y)/200;
var dx = (pt.x - mouseData.e.x)/200;
_wpfeTest.setPOV(mouseData.start.z + dy, mouseData.start.y + dx);
}

The changes in the POV cause the 3D view to be changed.

And that's it. Refer to the JavaScript and excellent OOP code by Alexey Gavrilov in the \js folder.

Resources

  • Microsoft SilverLight Downloads
  • Mix 2007 SilverLight Overview
  • Microsoft WCF
  • Microsoft LINQ
  • How 3D is Viewed on 2D Computer Screen?
  • 3D Objects Representation

Credits

The code from this article is based on a nice example from http://bubblemark.com/3d/silverlight1.1.htm.

Hope you enjoyed knowing a bit of SilverLight in this article. If you have any questions or suggestions, please post them here or drop me a line at srt@Suchit-Tiwari.Org or Suchit.Tiwari@Ge.com Your suggestions and comments are most welcome.

About .Suchit


Suchit is an Architect at GE India Innovation Center, Hyderabad.

He is the Architect of OPC Server for hardware devices of GE Sensing. These devices sense temperature, humidity, combustibles, fluid flow, pressure and various engineering parameters - primarily used in Industrial Automation & Process Control applications.

Interests: Computer Graphics, Mathematical Modeling, Scientific Applications Development.

He lives in Hyderabad India with his wife and 2 kidbots. Loves reading books if these 2 small buddies allow him to.

Homepage : http://www.Suchit-Tiwari.Org

Click here to view .Suchit's online profile.

"Silverlight" 카테고리의 다른 글
  • SilverLight Introduction (0)2007/07/10
  • Silverlight Architecture Overview (0)2007/06/21
  • Microsoft Silverlight 1.1 Development Reference (0)2007/05/03
2007/07/10 10:38 2007/07/10 10:38
Posted by webdizen
Tags Silverlight
No Trackback No Comment

Trackback URL : http://www.webdizen.net/blog/trackback/3071

Leave your greetings.

[로그인][오픈아이디란?]

Web/Silverlight2007/06/21 22:44

Silverlight Architecture Overview

출처 : http://msdn2.microsoft.com/en-us/library/bb428859.aspx

Barak Cohen

Microsoft Corporation

April 2007

Applies to:
  Silverlight Community Technology Preview (CTP) Feb 2007

Summary: This white paper provides a high-level overview of the Silverlight (formerly known as code name "WPF/E") architecture and how it fits into the Microsoft offering for building next-generation Web applications. Also, this white paper provides an architectural review of the Silverlight technology. (6 printed pages)

Contents

Introduction
Silverlight as Part of a User-Experience Continuum
Silverlight Architecture
Deployment and Packaging
Scenarios for Using Silverlight
Conclusion

Introduction

Microsoft Silverlight is a cross-browser, cross-platform plug-in for delivering the next generation of .NET based media experiences and rich interactive applications (RIAs) for the Web. Silverlight offers a flexible and consistent programming model that supports AJAX, Python, Ruby, and .NET languages such as VB and C#, and integrates with existing Web applications. Silverlight media capabilities include fast, cost-effective delivery of high-quality audio and video to all major browsers including Firefox, Safari and Internet Explorer running on the Mac or on Windows. By using Expression Studio and Visual Studio, designers and developers can collaborate more effectively using the skills they have today to create Silverlight web experience.

Silverlight as Part of a User-Experience Continuum

Now, more than ever, customers are demanding applications and online experiences that not only meet their individual needs in terms of effectiveness and efficiency, but also address the perception of satisfaction the user has with a company's products or services. In most cases, the level of satisfaction will have a network and an emotional effect, shaping perceptions of the company as a whole, and, as an extension, the perceptions of those with whom the individual comes into touch. Microsoft acknowledges this connection and has a made a renewed commitment to user experience (UX) as a part of the end-to-end experience. UX is more than a pretty UI; it is the aggregation of the interaction point of a user with an application. Our mission is thus to enable a great user experience wherever the customer needs that: on the Web, on devices, in Office, and in Windows.

Two recent examples of Microsoft's own investment in UX are Microsoft Windows Vista and Microsoft Office 2007. By focusing on the end-user experience first, subtle and somewhat radical changes were made to both products in order to address productivity and satisfaction.

  • Windows Vista introduces easier ways to visualize and organize your files, media, and communications. In every case of the UI, a focus on user-centric task accomplishment and experience was put first. Other examples of focusing on UX include the new task switcher (Alt+Tab) and Wi-Fi signal notification.
  • Microsoft Office 2007 has introduced the new "Ribbon" concept to replace traditional toolbars. A natural extension, the ribbon reduces time to find any given feature in an Office application to about 10 seconds.

Both of these decisions were heavily influenced by design and designers, working collaboratively with the rest of the development team. To learn more, visit http://www.microsoft.com/design.

사용자 삽입 이미지

Figure1. Microsoft UX continuum

From a platform perspective, Microsoft introduces a consistent offering that uses common skills to address the different application-interaction surfaces, as indicated in Figure 1.

  • ASP.NET AJAX offers the benefits of standard Microsoft support (around-the-clock support for a period of 10 years) for AJAX-enabled applications built around Web standards. It allows standard Web applications to be more effective by improving the interaction parameters of the application (such as refresh, resource usage, and navigation).
  • For Web experiences that need 2-D animation, vector graphics, and high-fidelity audio and video on the Web, Silverlight is being introduced to extend the capability of the browser to render XAML in addition to HTML. By embracing Web architecture for development, including industry-standard AJAX (Asynchronous JavaScript+XML) and inline XML markup (XAML) for presentation, Microsoft is working to break rich elements on Web pages out of the "black box" that exists today. As an added benefit, content authored in Silverlight and ASP.NET AJAX becomes more discoverable while offering the benefits of being cross-platform (Windows and Macintosh) and cross-browser (Internet Explorer, Firefox, Safari).
  • ASP.NET AJAX and Silverlight are designed to be complementary technologies. In the broader sense, Silverlight can interact with any AJAX application, both client- and server-side. Examples for such integration include mapping applications, video playback with rich presentation, and more.
  • For connected applications on Windows, Microsoft provides the .NET Framework 3.0 programming layer (shipped in Windows Vista and available for Windows XP) that includes the Windows Presentation Foundation (WPF). By using WPF, one can create rich, immersive, connected applications and experiences that can take full advantage of the Windows platform, including UI, media, offline communication, and document support. WPF uses a superset of the same XAML that is used by Silverlight.

사용자 삽입 이미지

Figure 2. Microsoft end-to-end offering for UX

As Figure 2 shows, Silverlight is not an isolated island; it is a piece in a consistent end-to-end offering that enables taking application experiences to the next level. This offering includes server-side components, tools (Microsoft Expression and Microsoft Visual Studio), and UX technologies.

Silverlight Architecture

Silverlight has few basic properties:

  • It integrates with various browsers on Windows and on the Macintosh.
  • It enables rendering of richer user experiences that are defined by XAML.
  • It render media (music and video).
  • It enables programming that is consistent with the Web programming model.
  • It is small.

Silverlight was designed to address these properties, as Figure 3 shows.

사용자 삽입 이미지

Figure 3. Silverlight architecture

  • Lightweight browser plug-in—Silverlight has Windows and Macintosh modules that are designed to enhance Internet Explorer (versions 6.0 and 7.0), Firefox 2.0, and Safari browsers. The December 2006 CTP for Windows is 1.1 MB in size.
  • Native presentation runtime— Software-based browser enhancement that allows rendering of XAML-based interactive 2-D graphics, text, and media, in addition to the browser native rendering of HTML. XAML can be used inline, in a file, or in a package.
  • Interactive video and audio—Cross-platform independent media runtime that can render Windows Media content (WMV and WMA) in addition to MP3 (will be available after the December 2006 CTP). Video and audio are handled as a media element in XAML, enabling flexibility in their presentation. Furthermore, the media support leverages the huge infrastructure and ecosystem around Windows Media, enabling cost-effective delivery of top-quality media.
  • Programming layer—In consistency with the Web architecture, Silverlight XAML is exposed using a DOM model to JavaScript. That way, AJAX programs can utilize the extended markup rendering capability using the same programming paradigms and practices (on the client and on the server). After the December 2006 CTP, we will also enable a managed code programming model using a subset of full CLR that will enhance the programmability side of the browsers to enable more performant and more scalable Web applications.

Deployment and Packaging

Content for a Web page that contains Silverlight elements can be created by using the following tactics:

  • Inline XAML and JavaScript.
  • External XAML files and JavaScript files.
  • Compressed content package (available after the December 2006 CTP) that contains XAML, managed code, images, fonts, and media. Streaming media sources can be referenced from the XAML media elements.

사용자 삽입 이미지

Figure 4. Silverlight packaging (after Feb 2007 CTP)

We believe that the flexibility of application packaging and the consistency of the application architecture with Web standards and operations will create many opportunities for improving the impact and effectiveness of Web applications, making applications more scalable, fault-tolerant, and dynamic (they can change their markup on the fly), and making content more discoverable.

Web pages that require Silverlight can detect if the Silverlight plug-in is installed, and can direct users to download it and install it (either through a redirect or through an object tag). The Silverlight SDK has documentation on that.

Scenarios for Using Silverlight

Silverlight is perfect for the following Web application scenarios that encompass many real-world scenarios:

  • Web media— Branded playback with events, video and marketing mix, dynamic videos with ads, audio playback, and so forth
  • Rich islands on a page (mini apps)— Casual games and gadgets
  • Web visualization elements— Navigation properties, data visualization, and ads

Silverlight is designed for Web page content that is connected to its host (it will not work offline), that deeply engages the user, and that can render on any browser.

Conclusion

This article provided a high-level overview of the Silverlight architecture and how it fits into the Microsoft offering for building next-generation Web applications. Silverlight is part of a larger revolution of the ways applications are designed, built, and delivered. With markup-based UI and flexible programming models, businesses will be able to offer better experiences on the right form factor for their customers.

"Silverlight" 카테고리의 다른 글
  • SilverLight Introduction (0)2007/07/10
  • Silverlight Architecture Overview (0)2007/06/21
  • Microsoft Silverlight 1.1 Development Reference (0)2007/05/03
2007/06/21 22:44 2007/06/21 22:44
Posted by webdizen
Tags Architecture, Silverlight
No Trackback No Comment

Trackback URL : http://www.webdizen.net/blog/trackback/3051

Leave your greetings.

[로그인][오픈아이디란?]

Web/Silverlight2007/05/03 14:43

Microsoft Silverlight 1.1 Development Reference

사용자 삽입 이미지
"Silverlight" 카테고리의 다른 글
  • SilverLight Introduction (0)2007/07/10
  • Silverlight Architecture Overview (0)2007/06/21
  • Microsoft Silverlight 1.1 Development Reference (0)2007/05/03
2007/05/03 14:43 2007/05/03 14:43
Posted by webdizen
Tags Development, Silverlight
No Trackback No Comment

Trackback URL : http://www.webdizen.net/blog/trackback/2887

Leave your greetings.

[로그인][오픈아이디란?]

«Prev  1  Next»

RSS HanRSS
Blog Image
webdizen
이곳은 컴퓨터에 대해 연구하고, 공유하고, 소통하기 위한 연구실입니다. 개인적으로는 OLAP, Data Mining, Semantic Web, Data Modeling에 대해서 연구하고 있습니다.

Categories

전체 (3009)
Webdizen (141)
Life (6)
Diary (16)
Blog (9)
IDEA (2)
Travel (10)
Book (16)
Photo (7)
Movie (8)
Music (14)
Leisure Sports (10)
Funny (6)
Hardware (121)
Software (120)
Windows (5)
Unix & Linux (120)
Installation (5)
Kernel (10)
System (34)
Develop (22)
X-Window (0)
Applicaton (31)
Security (4)
Framework (2)
Hadoop (2)
Programming (804)
Algorithm & Data Structure (1)
Assembly (38)
UNIX/Linux C (95)
C++ (128)
STL (4)
Java (38)
Win32 API (92)
ATL/COM (44)
MFC (151)
.NET (26)
WCF/WPF (4)
C# (28)
Network Programming (17)
Database Programming (12)
OpenGL / DirectX (13)
Multimedia Programming (0)
Game Programming (21)
Parallel Distributed Progra... (0)
Reverse Engineering (0)
Debugging (9)
Python (1)
Ruby (1)
Ruby on Rails (1)
QT (4)
GTK (0)
JSP (0)
PHP (6)
ASP.NET (6)
ASP (2)
Development (28)
Useful Library (2)
Data Modeling (0)
Database (105)
Oracle (4)
MSSQL (41)
MySQL (2)
Data Warehouse (2)
Data Mining (4)
Network (66)
Web (79)
DHTML (4)
XHTML (1)
Javascript (1)
CSS (1)
AJAX (9)
XML (11)
Flex (1)
Silverlight (3)
Security (91)
DoS (1)
Kernel (10)
Scanning (3)
Sniffing (0)
Spoofing (4)
Overflow (28)
Web (11)
Shell (10)
Format String (14)
Window (2)
Embedded (70)
Multimedia (27)
Mobile (14)
Graphic (24)
Management (633)
Knowledge (581)
Hadoop (0)

Notice

  • 메타 블로그 사이트에 등록
  • 새해 맞이 블로그의 변화
  • 블로그 명칭 변경
  • 도메인(www.webdizen.net) 구...
  • TEXTCUBE 1.6.1로 업그레이드...

Tags

  • 까벨렐로 리앙트
  • 화장품
  • 사용 가능한 메모리 크기
  • 아산관
  • 속도향상
  • 구글수표
  • Portable Executable File Format
  • 네트워크 라우터
  • 블로그플러스
  • CEO
  • stty
  • 유레일
  • Audio
  • 논리 로그
  • 모니터링 매커니즘
  • 진로 포도주
  • 형식화된 입출력
  • SCCM
  • Keyword
  • 슈크렘지

Recent Articles

  • 트위터(Twitter)의 시작!.
  • 청년 리더의 조건.
  • 애플의 타블렛 PC - 아이패드....
  • 미래의 인터페이스 - 육감 기....
  • 기초발성법 동영상 강좌.

Recent Comments

  • 학교 과제물중 쓰레드에 대하....
    장진혁 03/17
  • 관리자만 볼 수 있는 댓글입....
    비밀방문자 03/12
  • 상대방의 이야기를 열심히 경....
    DoNuts 03/03
  • Lots of students know techn....
    Bobbi35Shannon 02/25
  • 좋은글 잘 보고 갑니다..
    Und_hacker 01/08

Recent Trackbacks

  • printf,scanf를 이용한 형식....
    yundream의 프로그래밍 이야기 03/10
  • 파일 열기/저장하기 CFileDialog.
    은마군의 나태블록 2009
  • World IT Show 2008.
    상우 :: Oranzie's BLOG 2008
  • cvs서버 설치하기.
    3인3색 2008
  • 속속 공개되는 Google Chart....
    PHP와 Web 2.0 2007

Archive

  • 2010/02 (1)
  • 2010/01 (6)
  • 2009/12 (5)
  • 2009/09 (3)
  • 2009/08 (1)

Calendar

«   2010/03   »
일 월 화 수 목 금 토
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Bookmarks

    • Administration
      • IIS.NET
      • NTFAQ
      • OS의 모든 것
      • 리눅스포털
    • Database
      • SQL Server Central
      • SQL Team
    • Development
      • .NET Heaven
      • ASP Alliance
      • ASP.NET 2.0
      • Bullog.net
      • C# Corner
      • C++ (C PlusPlus.com)
      • C++ Reference
      • CodeGuru
      • CodePlex
      • DebugLab
      • Dev Articles
      • Devpia
      • DotNet Junkies
      • DotNet Zone
      • Driver Online
      • GOSU.NET
      • HOONS 닷넷
      • Joinc 팀블로그
      • KOSR
      • MSDN Home Page
      • OSR Online
      • Sky.ph - 개발자 커뮤니...
      • TAEYO.NET
      • The Code Project
      • WindowsClient.net
      • 김상욱의 개발자 Side
      • 조인시 위키
    • Human Networks
      • belief21c's e-space
      • I think I can
      • Invisible Rover's Blog :D
      • Rodman®
      • ■ Feel So Good~! ■
      • 까만 나비
      • 나를 가꾸는 시간.
      • 나만의 즐거움~~!
      • 단녕
      • 상우 :: Oranzie's BLOG
    • Information Technology
      • Microsoft TechNet
      • 지디넷코리아 - 글로벌...
    • Security
      • FoundStone
      • milw0rm
      • NewOrder
      • OpenRCE
      • Phrack.org
      • Reverse Engineering b1...
      • Reverse Engineering Team
      • RootKit
      • SecurityFocus
      • SecurityXploded by Nag...
      • Wow Hacker
      • Zone-H
Textcube
Louice Studio Inc.
Powered by Textcube. Original designed by Tistory.