matrix-transform

OpenGL 4.2 LookAt matrix only works with -z value for eye position

妖精的绣舞 提交于 2020-07-13 15:41:12
问题 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 commented in the code: If I set the eye coordinates of the Matrix4.LookAt to a z value that is greater or equal 0 or lower -2 the triangle is not visible anymore. Can someone explain why? As far as I understood the method the triangle should just be visible just from the other side (explicitly disabling

OpenGL 4.2 LookAt matrix only works with -z value for eye position

痞子三分冷 提交于 2020-07-13 15:40:26
问题 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 commented in the code: If I set the eye coordinates of the Matrix4.LookAt to a z value that is greater or equal 0 or lower -2 the triangle is not visible anymore. Can someone explain why? As far as I understood the method the triangle should just be visible just from the other side (explicitly disabling

MatrixTransform in combination with Width/Height of a Canvas

扶醉桌前 提交于 2020-01-15 10:34:28
问题 When zooming in on a drawing on a Canvas I have the requirement to show scrollbars. The Canvas is in a ScrollViewer and I increase the Width/Height of the Canvas so that that the scollbars appear (otherwise they don't). To zoom in with a factor of 1.1 I use this code: Matrix m = this.LayoutTransform.Value; if (e.Delta > 0) f = 1.1; else f = 1.0 / 1.1; m.Scale(f, f); this.LayoutTransform = new MatrixTransform(m); this.Height = this.ActualHeight * f; this.Width = this.ActualWidth * f; It turns

MatrixTransform in combination with Width/Height of a Canvas

拟墨画扇 提交于 2020-01-15 10:33:20
问题 When zooming in on a drawing on a Canvas I have the requirement to show scrollbars. The Canvas is in a ScrollViewer and I increase the Width/Height of the Canvas so that that the scollbars appear (otherwise they don't). To zoom in with a factor of 1.1 I use this code: Matrix m = this.LayoutTransform.Value; if (e.Delta > 0) f = 1.1; else f = 1.0 / 1.1; m.Scale(f, f); this.LayoutTransform = new MatrixTransform(m); this.Height = this.ActualHeight * f; this.Width = this.ActualWidth * f; It turns

keeping same Object size while zooming with same left origin in fabricJS

丶灬走出姿态 提交于 2019-12-24 11:18:05
问题 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._transformDone) { m = this.calcTransformMatrix(); ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]); return; } else { m = this.calcOwnMatrix(); //code I've wrote if (this.my && this.my.ignoreZoom != undefined && this.my.ignoreZoom){ var scaleX = 1.0 / this.canvas.viewportTransform[0]; ctx.transform(scaleX, 0, 0, 1, m[4] - 0.5, 0

matrix scale transition not working

て烟熏妆下的殇ゞ 提交于 2019-12-09 16:08:39
问题 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: 100px; background: yellow; transform: scale(0); transition: transform 1s; } .container.open { transform: scale(1); } https://jsfiddle.net/w4kuth78/1/ If I use the matrix itself, it is not working. .container { width: 200px; height: 100px; background: yellow; transform: matrix(0, 0, 0, 0, 0, 0); transition:

Animating planet orbiting it's parent idependent on parent's rotation state

£可爱£侵袭症+ 提交于 2019-12-08 03:54:20
问题 I'm trying to learn Three.js, beeing new to those technologies. I achieved a sun with planet orbitting around, with moon orbitting around planet. What am I concerned of, is to do what i have so far i have to make quite a lot of objects and perform quite a lot of calculations during rendering loops. 1. Sourcecodes: WestLangley provided us with fiddles presenting problem in more easy-to-understand way so: this fiddle presents more like it is looking right now - planet has its parent inside sun,

Generalizing the ScaleTransform (WPF) when image is not aligned to x-y axes

守給你的承諾、 提交于 2019-12-07 20:49:05
问题 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 edges have first been rotated, the result of applying the ScaleTransform will result in a skewed transformation (as shown below) since the edges are no longer aligned. So, if I have an image that has undergone several different transforms with the result being shown by the WPF rendering system, how

Animating planet orbiting it's parent idependent on parent's rotation state

耗尽温柔 提交于 2019-12-06 20:39:25
I'm trying to learn Three.js, beeing new to those technologies. I achieved a sun with planet orbitting around, with moon orbitting around planet. What am I concerned of, is to do what i have so far i have to make quite a lot of objects and perform quite a lot of calculations during rendering loops. 1. Sourcecodes: WestLangley provided us with fiddles presenting problem in more easy-to-understand way so: this fiddle presents more like it is looking right now - planet has its parent inside sun, and rotating that parent will make planet orbit. But along with one extra object per planet/moon,

Generalizing the ScaleTransform (WPF) when image is not aligned to x-y axes

末鹿安然 提交于 2019-12-06 13:22:10
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 edges have first been rotated, the result of applying the ScaleTransform will result in a skewed transformation (as shown below) since the edges are no longer aligned. So, if I have an image that has undergone several different transforms with the result being shown by the WPF rendering system, how do I calculate the correct matrix transform to take the (final rotated image) and scale it along the