Html5 + webgl 3D street scene rendering

Source: Internet
Author: User

Because of the collection software of Beijing street view in the early stage, there were a lot of street view pictures in the hand; and The Amazing effects of google Street View and soso street view gave rise to the idea of a small test, why don't I turn the image into a 3D street view and put it online. So I began to collect relevant information. After five days of trial, I finally achieved initial results;

First of all, thanks to http://www.hiwebgl.com /? P = 42 WebGL tutorials and source code provided by the website;

When it comes to 3D rendering, we have to talk about 3D modeling. What are the 3D models of google and soso street scenes? Yes, it's a sphere. It's just that the hiwebgl website has a sphere model, so I think again, can I mount a street view image to this sphere as a texture? Of course we can. So far, we have completed the work of street scene rendering 90%. At this time, there are several problems:

1. What we see at this time is not the 3D street view of google and soso, but the "Street View" picture hanging in the sky;

Solution: Do not translate the 3D model when rendering it;

2. After no translation, the "Street View" picture hanging in the sky disappears and is located at the origin to see the inside of the ball. However, another problem is found: the words in the picture are displayed as "Images ";

Solution: cancel the vertical flip of the texture image when loading the texture;

3. At this time, the image problem is solved, but the default street view looks reversed;

Solution: In this case, the current model is rotated 180 degrees around the X axis;

4. Another problem is that the street view is not on the front but on the right;

Solution: rotate the current model 90 degrees around the Y axis;

Finally, we need to note that when a street view image is used as a texture, its resolution must be an integer power of 2x2;

So much will be written for the time being. After I build the website, you will be able to see the effect.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.