ubilabs / google-maps-api-threejs-layer

Google Maps API layer that uses Three.js to for super fast animation
162 stars 36 forks source link

Repeat World Canvas #10

Open aemkei opened 8 years ago

aemkei commented 8 years ago

The Three.js scene is drawn from -180 to +180 degree, which results in a map that looks cut off at the date line:

screen shot 2016-05-12 at 6 52 49 pm

screen shot 2016-05-12 at 6 52 58 pm

@korczis suggested:

What about detecting that the world is displayed more than once and then somehow using css repeat feature to properly display overlay multiplay times.

aemkei commented 8 years ago

Unfortunately repeating the canvas is not a solution here, because it is cut off to the right, too. Guess, we have two options here:

  1. use multiple renderer for the same scene
  2. move particles to the other side (might be slow)
korczis commented 8 years ago

I think it is better to render it multiple times because if you zoom out you can see full worlds and even more than twice. See attached picture.

screen shot 2016-05-13 at 10 13 34 am

korczis commented 8 years ago

@aemkei Btw, is not option to do offscreen render without cutting and then use repeat functionality?

Or something like this (maybe I am completely wrong).

I am aware fixing this edge cases can be difficult but it will be super cool to have fixed them to have robust solution.

aemkei commented 8 years ago

I guess we have to issues here:

  1. dots on map won't repeat for small zoom levels
  2. map looks cut off on date line for high zoom levels

IMO we can ignore 1) for now, because we do not lose visual information. But we need to focus on 2) first!

Unfortunately, an offscreen won't work if you zoom in further because the canvas would be too big to render.

korczis commented 8 years ago

Why do you think that offscreen render will be so big? In my opinion the render target size should not be bigger than size of "one world" (in case there are multiple words displayed) which never will be bigger than canvas.

PS: Later today I will try to draw a picture of what I mean. English is not my native language so probably I express myself badly ;-)

rock7-dan commented 8 years ago

Using multiple cameras akin to this example should do the trick:

http://threejs.org/examples/webgl_multiple_views.html

korczis commented 8 years ago

@rock7-dan This is only part of problem, this does not solve issue with repeating rendered layer when more words are displayed.

rock7-dan commented 8 years ago

Following the approach used in that example, and two cameras side-by side would facilitate two worlds being shown at once.

You just adjust the masking between the left/right cameras depending which worlds are being shown. This strategy could be extended further with 3 or more cameras for additional worlds.

korczis commented 8 years ago

Hi @rock7-dan @aemkei I just wanted to share that I am willing to pay to have this functionality implemented ;-)