66 questions
0
votes
0
answers
57
views
How to calculate matrix transform for Canvas from polar coordinates
I have an image in 3d space of which I know some coordinates.
I'd like to use the HTML canvas to re-draw the image into a picture of set width and height.
For example when using this image:
I know ...
0
votes
1
answer
39
views
Transpose Vector Matrix in Idris2 With Dependant Types
I have trouble figuring out what my Idris2 Type- or Compile-Error is about, so I thought I could ask some Idris2 Veterans or Enthusiasts to give me some explanation on how I can make my approach work ...
1
vote
0
answers
174
views
Bevy instance example causes instance position to be inherited when new pbr entity is introduced
I'm running the bevy webgpu shader-instancing example with only the following addition:
commands.spawn(PbrBundle {
mesh: meshes.add(Sphere::new(0.2727).mesh().uv(10, 10)),
material: materials....
0
votes
0
answers
110
views
Determining visible center of SVG as rotation origin while panning and zooming
I'm developing an SVG viewer, using svg-pan-zoom library to pan and zoom the SVG.
What I want
What I want in the end is to be able to pan/zoom to a specific point in the SVG and be able to rotate from ...
1
vote
2
answers
89
views
How to detect which element is hovered on a CanvasRenderingContext2D with transformations?
I have a canvas on which I applied a few transformations (mostly translation to place the origin in the middle and a scale to zoom). I now want to find out if the cursor hovers an element drawn on the ...
1
vote
1
answer
332
views
CUDA-matrix-transpose-in-place-implementation for NxN matrices that iterates over upper traingular entries only
I am working on a matrix-transpose in-place-implementation, with the following idea:
Let the indices only take values that correspond to upper triangular entries (since diagonal ones stay constant ...
0
votes
1
answer
82
views
SVG initial zoom not working correctly (Matrix Transform)
I've recreated the SVG map from this article
The first time you zoom out with the "-" it zooms in, then kind-off correctly itself and happily works both ways!
I cant figure out why its ...
0
votes
1
answer
382
views
Transform matrix, convert one triangle to another: missing last step
I am trying to get the transform matrix from one triangle to another. I am principally concerned about 2D. We will see for 3D later (but open to solutions).
I was reading this answer.
Now please ...
1
vote
0
answers
111
views
STN: spatial trasformer network: Rotate and translate image
CNN is:
input: 2 image 128x128: input1 and input2
output: CNN return a Trasformation Matrix:
outLayer = Layers.Dense(3 * 2, activation=activations.linear,kernel_initializer="zeos",...
1
vote
0
answers
308
views
Android: 3D-transform an object
In an Android app I have an object that is created through a custom view. It basically has a rectangular shape. I want to apply a 3D transformation that makes it look like this:
In the draw() ...
0
votes
2
answers
392
views
How do you invert euclidean (transform and rotation only) matrices in C?
How do you invert 4x3 matrices that are only translation and rotation, no scale? The sort of thing you would use to do an OpenGL Matrix inverse (just without scaling)?
1
vote
1
answer
796
views
SVG getScreenCTM() on FireFox
GOAL
I am trying to build a signature pad in SVG. You can view
Sample project here.
Description
So far, it works in Chrome, Edge and Opera as desired but, in Firefox, getScreenCTM() doesn't account ...
1
vote
1
answer
2k
views
How to plot a 3D matrix with plot3
I have an image(mat file) and can access it as a 2D matrix 2*10095.
I then made linear algebra work on it to project it onto a plane with normal vector N =[1,2,3]and got the values for the 3D matrix (...
1
vote
0
answers
114
views
Finding a non-linear transformation matrix (like a fun house mirror)
What is the most efficient way to find a non-linear transformation matrix.
Conceptually, imagine a a normal image of a person and then the funhouse mirror image of the same person.
funhouseimage
How ...
1
vote
0
answers
1k
views
Use getPerspectiveTransform to obtain transformation matrix and then use it to transform a single point into warped space
I have the following image:
As you can see, there is a green point there with coordinates (x1,y1). Next, I identify some reference and target points in order to get the corresponding perspective ...
0
votes
0
answers
65
views
Calculating the distance on a parallel plane to the normal vector
My mathematics (and matlab) is just not up to this and so I humbly ask for your help:
I have a model of flow through a annulus. I want to get the radius of the peak flow point and the radius of the ...
0
votes
0
answers
73
views
Java how to enlarge a matrix
In Android, I have:
1) matrix (size is 257x257, float[257][257], each element represents a parameter to the image pixel);
2) image(size is nx257, nx257, bytearray[n*257][n*257]n is float, >=1)
How ...
1
vote
2
answers
182
views
matrix: move n-th row by n position efficiently
I have a numpy 2d array and I need to transform it in a way that the first row remains the same, the second row moves by one position to right, (it can wrap around or just have zero padded to the ...
1
vote
1
answer
4k
views
Translate and rotate a 3d point to origin with pcl transformcloud
Given a rotation matrix and translation matrix obtained from camera pose estimation of a corner of a charucoBoard, I want to transform one particular corner to the origin by using homogeneous ...
1
vote
2
answers
2k
views
How to get Bird's Eye View from KITTI by Projection Matrix?
The goal is to get the Bird's Eye View from KITTI images (dataset), and I have the Projection Matrix (3x4).
There are many ways to generate transformation matrices. For Bird's Eye View I have read ...
1
vote
1
answer
669
views
OpenGL 4.2 LookAt matrix only works with -z value for eye position
I am trying to understand and apply modern OpenGL matrix transformations. I already read a lot of different sources but I am not sure what I am actually doing wrong.
The issue I have is also ...
2
votes
0
answers
595
views
keeping same Object size while zooming with same left origin in fabricJS
I've seen this post and tried to do my own function using only the X scaling.
fabric.Object.prototype.transform = function (ctx){
var m;
if (this.group && !this.group....
1
vote
1
answer
560
views
Slant/Skew a Texture - Monogame
I am trying to Slant/Skew a texture to create some shadows for my game.
I have read over this helpful answer that shows this can be done by passing a matrix to spriteBatch.Begin().
Because my ...
0
votes
1
answer
34
views
R - Adding Data Frame to Matrix [duplicate]
I am trying to transform a data frame (treating as a vector) with locational data and a value onto a matrix that uses locational data as it's row and column names.
(Run snippets to see layout ...
0
votes
0
answers
199
views
Stop System.Windows.Shapes.Rectangle inertia if collision with another shape happens in WPF touchscreen app
I am working on touchscreen app. This app is for a certain industry, but the general ideals are all that is needed to explain issue. To start, im doing a crash course on WPF and am allowing a user to ...
1
vote
0
answers
713
views
Applying a Translation transform to Image C#
I'm trying to use the right mouse button for moving an image, using a MatrixTransform (I'm using MatrixTransform since I'm also scaling the image).
Here's my Xaml code:
<Image x:Name="StreamImage"...
2
votes
2
answers
3k
views
Transforming a list containing the elements below the diagonal of a matrix into a full matrix
I want to create a full-fledged matrix from a list of the elements that are below the diagonal. The following list contains the elements below the diagonal:
And this would be the desired output:
Up ...
1
vote
0
answers
322
views
Scaling in a second pivot point
I'm currently working with transformation matrices for game dev. One feature we have is a basic scaling, this is done when a user pinches the screen. Now we know that in order to scale/zoom in a point,...
0
votes
1
answer
1k
views
Problems with performing image translation in MATLAB
I'm trying to do image translation using MATLAB, and the image doesn't move at all. My code is:
myPic = imread('pic.jpg');
x = 250;
y = 375;
trans = affine2d([1 0 0; 0 1 0; x y 1]);
outputPic = ...
1
vote
0
answers
517
views
Center using MatrixTransform Translate
All I want to do is to center myObject in the middle of my UserControl using a method, I'm using MatrixTransform for scaling and rotating.
.xaml
<Grid>
<MyObject x:Name="myObject">
...
1
vote
0
answers
166
views
Radon transform for image watermarking in Matlab
I want to do digital image watermarking with Radon Transform in Matlab. But I am facing some problem at the beginning. Suppose I take a matrix and then I perform Radon and Inverse Radon transform on ...
2
votes
1
answer
963
views
How to keyframe animate a scale and rotate from an anchor point of a webGL cube?
I've created a cube in WebGL. I have an animation in mind but am struggling with make it come together.
The full code is roughly 150 lns of code so here's a working sample:
Working Plunkr Code
Here'...
0
votes
2
answers
1k
views
Calculating the new position of a parented controller after rotating the parent in Maya using Python
I'm creating code to create a motion path of a controller based on it's keyframed positions in Maya. I've run into a problem when trying to use this code to create a motion path of a parented ...
3
votes
1
answer
2k
views
Generalizing the ScaleTransform (WPF) when image is not aligned to x-y axes
My linear algebra is weak. WPF is a great system for Rendering different transformations upon an image. However, the standard ScaleTransform will only scale the image's along the x-y axes. When the ...
1
vote
1
answer
1k
views
Matrix Transpose in C
Suppose I define a matrix and assign the value in the following way:
double A[row * column];
for (int j = 0; j < column; j++){
for (int i = 0; i < row; i++){
A[j*row + i] = ((...
0
votes
0
answers
520
views
Dynamic Zoom on GraphicsPath using GDI+ matrix transforms
I am trying to implement a dynamic zoom on a GraphicsPath where the user draws a rectangle to define a zoom area (see selectRect in the code below). When the user releases the mouse the GraphicsPath ...
0
votes
0
answers
168
views
WPF Apply image MatrixTransform to source
Suppose I have WPF Image control, with underlying BitmapSource. Several transformations are applied to image, using MatrixTransform (scale and translate). Is there any way I could apply those ...
3
votes
0
answers
254
views
How does glm::translate() calculate the final matrix?
I am not clear about the procedure of glm::translate().
What's the difference between
result = glm::translate(MAT, glm::vec3 vec);
and
result = glm::translate(glm::mat4(1.0f), glm::vec3 vec) * MAT;
...
2
votes
0
answers
530
views
cumulative matrix transformation with ICP from PCL
My goal is to align 3D point clouds with ICP. Somehow I have an error, I believe it is because of the cumulative matrix transformations.
For debugging I start with 2D point clouds, I created. For ...
0
votes
1
answer
222
views
Matlab transform 2D matrix to 3D matrix
I have a 2D Matrix A like:
A = [ 1 2 3 4 5 6;
7 8 9 10 11 12;
1 2 3 4 5 6;
7 8 9 10 11 12;]
I want to transform this 2D Matrix to a 3D Matrix B with size 2X3X4, like:
B(:,:,1) = [1 2 3;...
0
votes
0
answers
584
views
Can 4x4 matrix be used for multiple 3D transforms?
I am doing 3D transformations using a 4x4 matrix. When performing rotations, for example, I am creating a 4x4 rotation matrix and multiplying the two matrices together. This is working fine.
...
0
votes
1
answer
2k
views
Using a matrix to position objects in 3D space
When using a 3D matrix transformation, is it possible to use only a matrix for each object to both position, rotate and scale the object? Would I also need to maintain a separate set of location ...
1
vote
0
answers
68
views
Auto transforming BufferedImage from side view/not perpendicular to perpendicular based on 4 points printed on list in Java
I see a lot of people just reading it... Maybe you need some extra info? Comment below and I'll give it!
As my previous questions were saying, I'm building a car that will orientate in the room based ...
1
vote
1
answer
1k
views
MatrixTransform rotate then translate image in xaml
I'm trying to rotate then translate an image with the simple Matrix.translate and Matrix.rotate methods, but for some reason when it's rotated 90º or 270º, if I try to translate it even an inch it ...
2
votes
1
answer
800
views
How to make a (matrix?) transformation permanently a RecyclerView
I'm currently working with a RecyclerView which has an horizontal LinearLayout. The RecyclerView occupies all the screen:
and I'm finding the way to make a fix transformation of the RecyclerView like ...
3
votes
1
answer
1k
views
OpenGL Matrix scale then Translate is still scaling my position
I am trying to position my text model mesh on screen. Using the code below, it draws mesh as the code suggests; with the left of the mesh at the center of the screen. But, I would like to position it ...
1
vote
1
answer
154
views
Transformation matrix from 2 groups of point pairs
I have tried using the command estimateGeometricTransform or fitgeotrans but it returns an object of class affine2d, and what I need is to generate a transformation matrix that can plot.
Is there any ...
8
votes
1
answer
2k
views
matrix scale transition not working
I have to use the transform matrix to animate transform: scale of an element.
I want to scale from 0 to 1.
If I use the following code it works properly:
.container {
width: 200px;
height: ...
4
votes
1
answer
1k
views
Mapping a texture from "1D" to "2D" with OpenGL matrix transformations
(With this question I'm trying to investigate an idea I had for solving this other one)
If I have a standard 2D array of dimensions width and height in memory, I can turn that into a 1D array of ...
0
votes
0
answers
341
views
Matrix Translate Translating Incorrectly
I am working ImageView and Matrix translation right now. I try translating an image with this code.
ImageView view = (ImageView) findViewById(R.id.imageView);
view.setScaleType(ImageView.ScaleType....