Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeat World Canvas #10

Open
aemkei opened this issue May 13, 2016 · 9 comments
Open

Repeat World Canvas #10

aemkei opened this issue May 13, 2016 · 9 comments

Comments

@aemkei
Copy link
Member

aemkei commented May 13, 2016

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
Copy link
Member Author

aemkei commented May 13, 2016

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
Copy link
Contributor

korczis commented May 13, 2016

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
Copy link
Contributor

korczis commented May 13, 2016

@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).

  • Move camera to proper place to prevent cutting
  • Do the render
  • Split rendered image
  • Move the right part to the left
  • Map it to canvas
  • Repeat mapped canvas texture

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
Copy link
Member Author

aemkei commented May 13, 2016

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
Copy link
Contributor

korczis commented May 13, 2016

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
Copy link

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

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

@korczis
Copy link
Contributor

korczis commented May 13, 2016

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

@rock7-dan
Copy link

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
Copy link
Contributor

korczis commented May 16, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants