Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [algorithm]

The tag has no usage guidance.

0
votes
0answers
5 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 ...
0
votes
0answers
20 views

PostScript's readstring: Is there a more efficient way to parse lines? [migrated]

(I hope this is the most appropriate StackExchange site for asking PostScript questions, but I realize there is no "postscript" tag available) A very old PostScript code of mine that parses input ...
2
votes
1answer
60 views

Why the Bresenham's algorithm does not work for those two points?

I am using the Bresenham algorithm from wikipedia: ...
4
votes
0answers
124 views

Pre-filtered environment map, deriving the equation

I'm reading through this article, and more specifically I'm trying to derive the equation that would explain the implementation the following shader (still in the same article): ...
0
votes
0answers
28 views

Arrange common items to spell out words

This seems like a pretty easy thing to do, but I've never done anything like it and I would rather not reinvent the wheel - so I'm looking for example code in pretty much any language or an algorithm ...
1
vote
1answer
25 views

How to scale primitive shapes [in Blender] so that they are within a [unit] sphere?

I wonder how is it possible to scale all shapes so that they are within boundaries of a [unit] sphere? I know how to do this for a cube: if radius of the sphere is S...
2
votes
0answers
85 views

HalfEdge data structure in openmesh, create_face function explanation

Does anyone have experience with open-mesh or computational geometry and can kindly explain what exactly happens in the function below? ...
1
vote
2answers
156 views

Very efficient/fast marching cube implementation

I was wondering if there's any known technique/algorithm that would compute a mesh generated by the marching cubes but hierarchically (like a divide and conquer strategy), in the implementation I know ...
1
vote
0answers
22 views

Help with efficient quadtree vertices indexing to avoid redundancy

I am creating a quad tree from ground zero, because I am going to collapse it from bottom up I am refining it with a certain LoD level. I am using glm for mathematics and opengl for rendering. ...
1
vote
0answers
40 views

Anti aliasing thin features in textures

Assume I have a texture with a repeating line pattern. The lines are exactly 2 texels wide (really thin). Ans very spaced out (50 texels in between each line). I am now struggling with the ...
2
votes
0answers
31 views

Mantiuk's contrast mapping seems to amount to a gamma correction

I'm reading this paper and one thing sticks out at me. Let's say I use the approximate transducer: R = 54.09288 ·G^0.41850 Then I scale it: ...
-1
votes
2answers
106 views

What is a list of common, cheap, real time rendering algorithms?

I am well aware of the existence of Blinn-Phong shading, which is a great tool when you are doing, for example, modelling algorithms and wan't to focus on the model. In this case a full BRDF result, ...
3
votes
1answer
78 views

Tiled Image Palettization Algorithm?

In most cases today, image palettization consists of reducing the overall number of colors in an image to some fixed number globally. This is typically solved as a straightforward but computationally ...
0
votes
2answers
77 views

An algorithms for covering a 2d polygon with a predetermined number of rectangles?

I am looking for an algorithm that is able to cover with non-overlapping rectangles in a pre-defined number and minimum area a generic 2d-polygon. Polygons are usually free-hand draws, so they can be ...
3
votes
1answer
117 views

What algorithm is used in this animation from Tatami Galaxy?

Is there a name for this type of effect where many area sizes are increased/decreased in relation to each other? I'm looking for some type of algorithm, formula, logic, etc. for recreating this. Here ...
1
vote
1answer
38 views

Make a texture a clickable Button

What would be the best way to make a texture a clickable button? Suppose I have a Room (respresented by a 2D texture), where there are buttons. Would I in the main loop: check when the mouse is ...
4
votes
1answer
68 views

How to shift color values of a single RGB channel

I’m a weaver and textile maker with no prior coding or programming experience. In researching and reading through posts on this and other message boards, I was able to find a lot of useful information,...
0
votes
1answer
74 views

Bresenham's algorithm next pixel?

In line drawing, bresenham's algorithm was explicitly derived for lines with slopes between 0 and 1 in the first octant from point P1 to point P2, where the x value of P1 is less than that for P2. In ...
7
votes
2answers
812 views

Why are oct trees so much more common than hash tables?

When reading papers I commonly find Oct tree implementations of geometry representations to sort the data. However whenever I think about the problem hash tables seem better overall. Hash tables have ...
0
votes
2answers
356 views

Z-Buffer algorithm vs Painter's algorithm?

In hidden surface removal, how does the Z-buffer algorithm work vs. painter's algorithm?
1
vote
1answer
179 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
26 views

How can I register an articulated model to noisy predictions?

Given point sets $Y$ and $M$, I'd like to register articulated $M$ to $Y$ without changing the edge distances of $M$. The point correspondences between $Y$ and $M$ are known and points have a fixed ...
1
vote
0answers
37 views

Why the interval for which there are more number of steps is chosen while implementing DDA Algorithm?

I was studying the DDA Algorithm and learnt that initially we calculate both the x-difference and the y-difference between the start and the end points of the given line, and if dx > dy, we choose ...
1
vote
1answer
104 views

Deciphering Affine/Projective Transformation Code

I've spent about 2 days trying to understand this piece of code (from here) that applies an affine/projective transformation to an image. I will link bits of the code that I'm struggling to understand ...
2
votes
0answers
49 views

Cem Yuksel's “Mesh colors” implementation/demo?

Are you aware of any sample implementation or demo application of Cem Yuksel's "Mesh Colors" or "Mesh Color Textures" (http://www.cemyuksel.com/research/meshcolors/) ? The author does not provide any ...
2
votes
1answer
346 views

Feeding vertex data to a compute shader

I'm writing a CAD program in vulkan. In my current design, I have line paths represented as large vertex buffers for rendering. I would like to implement an algorithm for extruding the path outwards, ...
1
vote
1answer
319 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
28 views

How are non-triangular wavefront meshes handled?

I have a wavefront loader, however it only works with triangular meshes. I have been trying to think how to handle faces with arbitrarily many vertices but I have no idea how they are to be handled ...
1
vote
1answer
138 views

How does the Painter's Algorithm handle transparency?

I was wondering if anyone could explain how the Painter's algorithm would handle transparent objects? Can the Painter's algorithm handle transparency?
3
votes
1answer
433 views

What is the use of epsilon in the Möller–Trumbore intersection algorithm?

The Möller–Trumbore intersection algorithm compares the determinant with an epsilon. What is this epsilon and how is its value chosen?
-1
votes
1answer
111 views

How to test my triangle intersection implementation?

I've been thinking about this question for a quite long time.And my implementation seems to be correct for some cases but wrong with few others. How can I comprehensive test the algorithm? Is there ...
1
vote
1answer
78 views

Quick 2-color quantization for small images

So I have a small (8x8 pixel) image in 24-bit color. I want to be able to (quickly) generate a color-quantized version of the image that only has two colors. One naive approach is to cluster a luma ...
4
votes
1answer
118 views

Can someone explain this formula for parse RGB to HSL?

Im trying to complain the algorithm to calculate the HSL value form a RGB color. I understand the algorithm for the Hue, but im lost with the Lightness and saturation. Someone can explain why? There ...
1
vote
0answers
71 views

How to guarantee rasterization of triangles in a voxel representation

There are 2 problems i am trying to solve involving rasterization of geometry in 3D. The first is, my 3D texture is created with a top down viewd, so triangles that are perfectly orthogonal to the ...
1
vote
0answers
37 views

Which vertices to use to create side of model

I hope I'm asking on the right StackExchange site. Apologies if I'm not. I want to generate 3D triangulated models of optical lenses, circular in shape. I can create the meshes for the front and back ...
1
vote
1answer
68 views

How to obtain a parametric equation out of a part designed in Autodesk Inventor?

Whenever you make a part in inventor, the software calculates de properties of the whole body given a constant density. Then, automatically, it shows the inertial tensor. As you can recall from math, ...
3
votes
1answer
192 views

How to smooth out a voxel grid?

So I am facing the following issue. Say I have a minecraft like mesh (i.e I have a bunch of cubes on top of one another). I wish to smooth out this mesh in such a way that only the regions where ...
2
votes
1answer
112 views

how to build the feature curves of this algorithm?

I hope this is the right group to be able to expose my doubts about the implementation of the algorithm shown in this article. The question I have is how to do the feature curves, what I do not ...
4
votes
1answer
336 views

Simple Intersection Algorithm for Ray and 3D Bézier Curves of Varying Thickness

I'm trying to get an algorithm for intersecting a "tube" (a 3D cubic Bézier curve extruded by a possibly-changing radius) with the following required properties: Computes intersections of ray and a ...
4
votes
1answer
272 views

How to calculate curvature of isoline of image

I've got a discrete grayscale image (a.k.a. 2D rectangular array of floats). Its continuous representation (whether received via reconstruction with sinc, with a cubic kernel, with a triangle kernel......
4
votes
3answers
1k views

How to modify Perlin (not simplex) noise to create continental like terrain generation

I have been playing around for a day with Perlin noise, and I am currently stuck. Most of the modifications I have made to the algorithm produce more or less the following: Now, this is a very good ...
3
votes
1answer
206 views

Help understanding Perlin Noise

I am following this tutorial: Understanding Perlin Noise | Blog To understand Perlin Noise. In particular, right now I am focusing on the following code section: ...
1
vote
1answer
63 views

Are there LOD Algorithms that work through removing objects?

I want to implement a LOD algorithm that reduces the number of objects rather than the number of vertices of the objects. Imagine a forest, then close up I want to see all the trees but moving away ...
3
votes
1answer
54 views

Calculate set of rectangles covering pixel diffs?

I'd like to develop a system for web animation similar to animated gifs, like this one. I capture a series of screenshots at fixed time intervals, and then I'd like to animate them. I can trivially ...
7
votes
1answer
232 views

Visualizing the Lane-Riesenfeld Algorithm

Ok so, I keep reading papers about this and non of them have pictures. The lane Riesenfeld algorithm provides a way to subdivide set of points with B-spline conversion. The quesiton is simple HOW? If ...
2
votes
0answers
74 views

Algorithm for 3D mesh model segmentation to chart

I'm trying to implement a segmentation model which will divide a 3d mesh model into charts. But I'm having really hard time to find resources in the web. The papers and some other places these ...
2
votes
1answer
140 views

What is a common approach to smooth structures in textures?

I have a screen-aligned texture resulting from multiple rendering passes. It looks about this: I want the edges to appear smoother than they do now (but still keep their characteristic shape). When ...
1
vote
1answer
62 views

Finding all possible reflection matrices for a given Wythoff construction

As a pet project, I'm trying to build a small app that visualizes 4D polytopes. I want to use the Wythoff Construction method, where the shape is generated kaleidoscopically by the interaction of 4 ...
1
vote
0answers
104 views

Algorithm for clipping convex quadrilaterals

I'm dealing with hardware that uses quads as its polygonal primitive. Not triangles. A triangle can be expressed by setting 2 of the 4 vertices equal to each other for a degenerate quad. For the 3D ...
4
votes
0answers
71 views

Slope Based Texturing

On the main page for Allegorithmic's Bitmap2Material, it mentions that the software uses a Slope Based approach over a Luminance Based approach. What exactly does this mean?