Questions tagged [javascript]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
35 views

Is it possible to get recording device from meta data?

Im not sure if this is the right section to ask this question but i figured its worth a shot. Is it possible to take metadata from a video and use that data to identify what phone model was used to ...
0
votes
0answers
13 views

How to add a second calculation to an already working transform feedback webgl2 code?

I'm doing a project that involves transform feedback and WebGL2. I was able to make a transform feedback work using two buffers, to calculate an update in 3d positions of particles. But now I'd like ...
0
votes
1answer
59 views

Fastest Simulation Of Mass Spring Systems

I'd like to simulate a 4-dimensional cloth in the web browser, since browsers don't offer great ressources for numerical computation, I'd like to know which algorithm uses the least amount of ...
0
votes
0answers
22 views

How to draw a pdb 3d structure in webgl?

I am trying to create a 3d structure in webgl using 3d coordinates from a pdb file mentioned below: https://www.rcsb.org/structure/1RE2 I don't know which one is the appropriate one, so i used gl....
1
vote
1answer
183 views

Rotating a Bitmap

I would like to rotate an bitmap image using math. I have two issues with my current implementation: the pixel-by-pixel rotation of the copied bitmap is extremely slow and it is leaving gaps between ...
3
votes
1answer
132 views

Non jagged line algorithm for javascript canvas

I'm trying to draw a line between two specified points, by updating values in an array which is heightxWidth with each element a set of four bytes (r,g,b,a). In my naive implementation I get the top ...
-2
votes
1answer
424 views

How can I make a cube with faces of different colors? Webgl

I have to draw cubes with faces of different colors (each per face), but I don't know how to accomplish this task: I draw cubes using CPU and GPU meshes (no vertexBuffer or three.js "style") and I don'...
1
vote
1answer
397 views

Flood-Fill and scanLine algorithms are line-based floods but I want square based floods

I have a flood-fill algorithm (Flood-fill) to fill a 24x24 matrix as follows (matrix is 24x24 here but will be much bigger in production): ...
2
votes
0answers
54 views

Binary representation of Pascal's triangle [closed]

I recently learnt about the binary representation of Pascal's triangle. Here is what it looks like I am a java learner. Is there a way for me to find the java source code to graph this binary ...
1
vote
0answers
188 views

How can I convert a shape made out of pixels to vertices

I'm trying to implement the solution to get the minimum dissection into rectangles of a rectilinear polygon. My shape is made out of pseudo-pixels (different width/height) but for the moment let's ...
1
vote
1answer
1k views

How can I draw a filled circle on a grid with the less rectangle as possible?

I have a grid with a variable width/height spacing. Let's say 100 horizontal lines separated by 80 pixels and 100 hundred vertical lines separated by 50 pixels. Each cell of the grid in my logic have ...
1
vote
0answers
426 views

3D model outline using stencil buffer

I'm trying to outline a 3D model in WebGL. I've tried using a stencil buffer techique with glLineWidth and glPolygonMode. However, Mozilla's WebGL reference says that the minimum and maximum widths of ...
0
votes
2answers
266 views

The distance from the cube sides to the parallel projection plane

I have asked this question on ru.stackoverflow.com and have no valid answers. Specification: Coordinate system Cube spins around its center on all three axes. Turn angle is not known previously. ...
5
votes
1answer
853 views

How can I verify if a selection area is over a shape in SVG?

I'm creating an SVG editor. I have a simple selection tool that appears when I click and move my mouse from a blank area in my SVG. My SVG is populated with rectangles that can have a rotation ...
3
votes
1answer
89 views

Need help reasoning about video oscillation >60hz

I want to make a basic video oscillator for the web. What I want to do is basically illustrated in a tutorial for Lumen: essentially, I want to define an oscillator to turn on and off a color signal ...
3
votes
1answer
140 views

Image regeneration with nearest neighbor search

So what I would like to achieve is this: User submits Image 1 - this image is then broken down into X by X sized blocks User submits Image 2 - then the program/algorithm takes all the blocks ...
3
votes
1answer
2k views

WebGL: Why are my textures black?

I am trying to write a simple WebGL script to display a pyramid with a brick texture and Phong lighting. The lighting works fine but when I incorporate the texture, the pyramid turns black. I've ...
3
votes
1answer
399 views

Russian Roulette - Maximum call stack size exceeded

I am trying to write my own path tracer in JavaScript, but I have a problem with the implementation of russian roulette. First, let me describe how my path tracer works. I have a function called ...
2
votes
1answer
319 views

Easing curves on the GPU?

I was thinking that I could pass a timestamp in (from requestAnimationFrame) to the vert shader, and just have my easing curves in the GPU instead of using (for example) Tween.js from the outside. Is ...
1
vote
0answers
166 views

How To Generate High Quality Bitmap From Canvas For WebGL Texture

I would like to generate a bitmap for use with a webgl texture generated from a 2d canvas, but I don't think I am doing it correctly. I know how to display the contents of one canvas into another by ...
2
votes
1answer
499 views

Inverse Kinematics with more than 2 segments

I'm building a 2D inverse kinematics system and can't figure out how to find all the joint positions. I have the math to make a typical IK set up with a single bend (e.g. arm, leg), but I get stuck ...
4
votes
2answers
466 views

Can a scene graph be stored in the GPU?

I am starting to learn WebGL. Can a scene graph be stored in the GPU? Or is that type of thing more for the main thread (or webworker)? For example, I want to calculate some layout, and apply it as a ...
2
votes
0answers
476 views

Creating Signed Distance Fields Images On The Fly For WebGL Application

I am working on a "CAD" like program in HTML5 that requires drawing many thousands (700,000+) of images on the screen. I think, "fortunately" the many images are replicated uses of a unique set of ...
1
vote
0answers
43 views

View / print index values?

So i'm currently trying to draw a 3D cube, and from what I understand everything should be working right, but It's coming out weird and I believe it's because the ordering of my indexes is wrong. Is ...
2
votes
1answer
51 views

Successive lineTo(x, y) in JavaScript

When I was doing some graphic designing with JavaScript, I saw this strange behaviour. When I ran the following code (with proper HTML and JavaScript of course), ...
4
votes
1answer
924 views

Can we use PhysX in WebGL?

I'm new to GL stuff (coming in via WebGL, with no direct OpenGL experience). Can we use PhysX with WebGL?
4
votes
1answer
935 views

draw a chord in three.js as in d3.js

I'm starting to learn three.js and want to create a chord diagram as possible in d3.js, but from ground up. I've created a scene and have circle segments on xz axes. But I got stuck on the chords. I ...
1
vote
0answers
46 views

Trouble using java connectivity and data transmition on libgdx [closed]

Hello everybody i have a trouble making datatransmition with mine program just to give the idea im trying to move this blocks when i move mine cars Here I leave the encoding of mine server/client ...
1
vote
1answer
84 views

Get data from javascript

There is an web-interface that load geometric models and show it inside the bounding volume. WebGL is used to generate it. So far no scene graph technique is used to organize the elements in the scene....
3
votes
1answer
179 views

Javascript color extraction library

I have a small project that needs to extract the perceptually-salient colors of an image, in javascript. There are a few libraries out there (color-thief.js, vibrant.js). The trouble is, I'm finding ...
8
votes
1answer
206 views

Can I determine the pixel geometry programmatically?

Different screens can have different pixel geometry, so that the red, green and blue components are arranged in different patterns. Using sub-pixel rendering to give a higher apparent resolution is ...