Steven Ryssaert
Steven Ryssaert

Reputation: 1967

isometric perspective in silverlight

How can I get a perfect isometric perspective in Silverlight ?

I want to create a 3D environment in Silverlight, which has to be in Isometric perspective. If I use the planeprojection, I can make a grid resemble the Isometric perspective, but it is not a perfect Isometric perspective, as the gridcells are not equal.

http://uwconcept.be/projects/uwconceptcity/grid_base_1.jpg

People will have to be able to "scroll" along the grid; i.e. move forward, backward, left and right on it. You can see it as flying over the grid, but keeping the correct Isometric perspective at all times. Rotating will not be implemented ( in a first version ). And even if it would be implemented, the rotating would be exactly 90 degrees, as to keep the Isometric perspective.

Edit: I also noticed that the "normal" isometric x,y,z Coordinates do not apply when i tried to reproduce the perspective in Silverlight. The "normal" transformations are shown in the following Wikipedia article: http://en.wikipedia.org/wiki/File:Wikipedia_isometric_cube_3.jpg

Upvotes: 2

Views: 1086

Answers (2)

foson
foson

Reputation: 10227

If you can wait for SL5 to be released, it is supposed to have a 3D API. Silverlight 5 beta was announced for release in the 1st half of 2011 (should be any day now). The final release is planned for the end of 2011.

I assume the SL API should be similar to WPF's 3D API. From my casual understanding, you can create an isometric projection with the correct angling of an OrthographicCamera (which is included in WPF).

Upvotes: 1

Rune Grimstad
Rune Grimstad

Reputation: 36310

The built in 3d projection support in SL4 is probably not adequate for you needs. It is very limited and is generally only useful for rotating simple objects.

But you have two other options:

  • Use a 3D engine and set it to render in isometric 3D. I think Balder can do this for instance, but probably not out of the box.
  • Fake the isometric 3D by drawing pre-rendered sprites at the correct position. I suppose you want your "game world" to be built up of tiles (squares) that are rotated to fit the isometric 3D perspective. If you pre render all the tiles in the correct angle then you can calculate where to place them and get the desired effect. Using this option you won't get any depth in the display, tiles farther away will be the same size as those nearby, but apart from that it is not too hard.

I tried to do that latter myself once, just for fun. It was quite easy to draw a flat landscape, but it gets tougher once you want to support slopes.

If you end up doing this, then I hope you open source the project, for there is so much fun you can do with isometric 3d :-)

Upvotes: 1

Related Questions