Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am trying to create a service that allows real-time concurrent modification of canvases by more than 2 users. I have been exploring the literature behind the best ways of doing this and have not found a lot to go of off.
So far I have found methods which serialize the canvas using the canvas.toDataUrl(). The issue here is that it seems rather inefficient to redraw the entire canvas when only very few pixels have changed (that is, when another user modifies it).
I do not really know where to start with this particular project and would love some help with that.
No more than 40 users would be looking at the canvas at once.
Depends on what and how users are drawing.
If they can draw/manipulate only predefined set of primitives, like software block chart then you can send just list of JSON serialized data describing those primitives and their location.
If drawing is just a pixel bitmap like this http://intridea.github.io/sketch.js/ then you can do drawing into bitmap and broadcasting that bitmap serialized as PNG on mouseup or so.
To publish this to all users I would do something socket.io based. Node.js for example has a lot of samples of how to do socket.io based chats. Chat is conceptually pretty close to what you want to achieve.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I would like to write a program that "arranges" multiple audio buffers. Similar to a DAW, I want to "layer" audio tracks on top of each other at custom timestamps. Is this even possible, and if so, how would I implement it?
I apologize in advance for this extremely general question, but I couldn't find any good resources on this topic. Thanks for the help!
Yes, this is possible.
First, load your audio data into AudioBuffer instances.
Next, you want to create an AudioContext, which is basically the root of a graph of connected nodes where your audio flows about.
Now, create an AudioBufferSourceNode for each AudioBuffer and connect it to the audio context's destinationNode. This basically plugs a buffer player directly to the output.
From there, you can call .start() on your AudioBufferSourceNode instances to play them back immediately, or schedule them to play at some point in the future.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm working on a web-based augmented reality project based on THREE.js and AR.js.
The problem I'm facing is that when the "marker" is off my camera, the augmented reality image dissapears or get stuck to the side of my screen.
Vuforia version 2.8 has solved this problem. Vuforia SDK 2.8: Now with Extended Tracking
Does similar kind of solution exist for web augmented reality using AR.js?
Sorry, this is not possible. Somebody asked pretty much the same question on the GitHub tracker of AR.js:
Honestly, if you want to be able to have AR content without marker
images constantly present within view of the camera, there's really
only one alternative: SLAM-based AR. e.g. ARKit or ARCore (formerly
Tango). These API's are not available for browser, but if you're
interested in WebAR without markers, look into:
https://github.com/google-ar/WebARonARCore
https://github.com/google-ar/WebARonARKit
Otherwise, this is your best
option if you can handle having markers in view of the camera 100% of
the time (if that's what you're asking about). p.s. I've not tried
AR.js w/ multi-marker images yet (I've since moved away from it in
favor of the above).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I found this site Storj.io. I really like the design of the site and was looking at the header. There is a background-image and then on top of this there are those points that are moving. How can such a animation be achieved? Is this done with html5 and how or is JavaScript used?
Inspection reveals they are using Particles.js
Particles JS
They provide documentation to get you started and achieve the effect you are looking for.
Your question is too broad for a complete answer. Try asking about smaller parts of it when you get stuck.
From Scratch: In essence you'll want to look into using the <canvas> element to draw particles. Take a look at this simple example of what can be done. Here is a blog post on particles with canvas to get you going (which culminates with the previous example).
With a library: https://storj.io is using particles.js. But that doesn't tell you how it's accomplished. On the plus side though, the library can easily be included from https://github.com/VincentGarreau/particles.js/ (see the demo on codepen).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to display 1000x1000 array in some way. Array element would either be black or white, depending on boolean value. For this job I am thinking about either javascript or winforms, but before I jump into, I wanted to hear what could be drawbacks for these choices. I am much more familiar with javascript than winforms though. As for winforms, I tought that there could be too many GDI objects to handle. Any ideas, suggestions?
I'm not familiar with win-forms but the first idea that came to mind was just a plain old html table. It would be a lot of html though to have 1000 x 1000. Second thing that came to mind would be an SVG. You can manipulate an SVG with JavaScript as shown here http://tutorials.jenkov.com/svg/scripting.html. Theres also this post which shows how to create tables with SVG.You would probably want to generate the SVG before hand to save the application from doing a lot of work and then set the colors using a loop. You can even use photoshop and save as SVG and then open the file in an editor to get the SVG code.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
If you're not familiar with the concept of a Microgame, check out this video of WarioWare Twisted.
I'm interested in setting up a site where users can play series of browser-based Microgames which are delivered to them by a server. Ideally this would allow me to crowdsource the games and have an open submission system. What sort of scheme could I use to make this work?
I'm thinking that one way to do it would be to have each game consist of:
A javascript file that defines a MicroGame object that controls a rectangular portion of the screen, gets input and timing information from the main page, then calls back to the main page with a "Success" or "Failure" message.
A folder of assets that must be downloaded before the game executes.
Is this possible to do, client-side within a browser? Where would be a good place to start figuring this out?
There are a lot of open issues here. The biggest problem is what language do they submit games in which you can execute safely on the players machines? That said, there are tools like this out there. You could look at the excellent Play My Code for inspiration.