7 votes

Can a scene graph be stored in the GPU?

Short answer: Yes, It can be done. But no one does so. Long answer: Scene graphs can be stored and processed on a GPU using OpenCL/WebCL. But it is not practical to do so. Updating scene graphs (a ...
Mary Chang's user avatar
5 votes
Accepted

Russian Roulette - Maximum call stack size exceeded

Forking defeats Russian Roulette A key difference between path tracing and ray tracing is that unlike ray tracing, which can have a branching tree of rays splitting at each intersection, path tracing ...
trichoplax is on Codidact now's user avatar
5 votes
Accepted

Can we use PhysX in WebGL?

PhysX is a C++ API and can thus not directly be integrated with the JavaScript-based WebGL. Depending on your needs, you have the following options: Use a JavaScript-based physics engine, mostly ...
David Kuri's user avatar
  • 2,293
4 votes

WebGL: Why are my textures black?

Okay, I figured it out. It has to do with the texture not loading before the first display function is called. The texture displays after a mouse or keyboard event. To remedy this, I added a timer to ...
mago3421's user avatar
3 votes
Accepted

Move the camera in orthographic 3D

It seems that some basic computer graphics knowledge is missing. Normally you have two matrices for the camera (viewMatrix and projectionMatrix), both are 4x4 matrices. The viewMatrix stores the ...
Thomas's user avatar
  • 1,265
3 votes

Need help reasoning about video oscillation >60hz

Yeah, that makes sense. Most flat panel monitors on the market have a 60Hz refresh rate! So you are not going to be able to flicker faster than 60Hz due to technical limitation. Were you to do this ...
joojaa's user avatar
  • 8,437
2 votes

Successive lineTo(x, y) in JavaScript

Straight from the specification of lineTo: If the object's path has no subpaths, then ensure there is a subpath for (x, y). And "ensure that there is a subpath" ...
Martin Ender's user avatar
  • 2,730
2 votes

Get data from javascript

There does not seem to be a single answer for this question, but I will try to give some directions in possible solutions. First of all I presume that "the scene graph technique" means storing the ...
Maurice's user avatar
  • 451
2 votes

Easing curves on the GPU?

This is a pure optimisation problem. It depends on many factors like: What you need to do with the tween How many different tweens you need to calculate How much signaling between systems you need ...
joojaa's user avatar
  • 8,437
2 votes

Inverse Kinematics with more than 2 segments

What you have here is an underconstrained problem*. To solve this problem you do what you do to any other underconstrained system. This is also why you mostly only see the 2 joint version as it is not ...
joojaa's user avatar
  • 8,437
2 votes

Rotating a Bitmap

You have to loop over destination pixels instead of source ones (gaps are the result of looping over source). For each destination pixel you can calculate position in source data, your code for pixel ...
Sergio's user avatar
  • 71
2 votes
Accepted

Non jagged line algorithm for javascript canvas

The problem you are seeing, i.e. "jaggies" or "staircasing", is an example of the more general problem known as "aliasing" and, in the graphics field, the term you want to search for is "Antialiasing"....
Simon F's user avatar
  • 4,241
2 votes

Is it possible to get recording device from meta data?

There's a tool called ExifTool that can extract various forms of metadata from video and audio files. Here is an example (from 2013) of using the tool on a .mov file from an iPhone, which includes ...
Nathan Reed's user avatar
2 votes
Accepted

Convert between screen and world coordinates in isometric 3D

Since the screen coordinates are 2D, while the world coordinates are 3D, the problem arises that you still have one degree of freedom open. A pixel on the screen therefore represents a line in world ...
Thomas's user avatar
  • 1,265
1 vote
Accepted

Position a 3D camera directly above or below the target

This can be because of multiple reasons: first as @gallickgunner said, the up vector which is passed to the lookAt function should not be alligned to the view ...
Thomas's user avatar
  • 1,265
1 vote

How to apply transformation matrices from multiple primitives on a mesh

In the glTF format, "primitives" are just a way to specify separate draw calls (and hence, separate materials or shader programs) for a single mesh. There is no transform, as you've ...
emackey's user avatar
  • 369
1 vote
Accepted

Fastest Simulation Of Mass Spring Systems

Time integration with implicit Euler is unconditionally stable. This means you can choose arbitrary large time steps without worrying that your solution "explodes". In contrast to explicit ...
wychmaster's user avatar
  • 1,251
1 vote

Image regeneration with nearest neighbor search

I would have done it with a script and NETPBM like so: 1) reducing Image1 (the tiles) to size X by X -> Image1R 2) recording the mapping from pixel values of Image1R to coordinates (no need to ...
Leo B.'s user avatar
  • 141
1 vote

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

To get a proper circle, you can use a transformation matrix to transform your cell coordinates into equally spaced cartesian coordinates. In the case of your 50 x 100 pixel cells, your transformation ...
user1118321's user avatar
  • 3,411
1 vote
Accepted

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

In pseudocode For each rectangle: If the rectangle overlaps the selection area, highlight the rectangle This is all that is required for a correctly working ...
trichoplax is on Codidact now's user avatar
1 vote
Accepted

Can a scene graph be stored in the GPU?

A gpu only cares about the full transform used for a particular object. It's much better that the CPU (webworker) collates the transformation hierarchy into a single matrix. What you can do is use ...
ratchet freak's user avatar
1 vote
Accepted

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

Ok, I've found the solution myself. It goes like this: ...
user2229608's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible