transformation

perspective to world space inverse projection

隐身守侯 提交于 2019-12-25 05:12:08
问题 i am extending shadow feature to my already existing 3d renderer that i have created as my class homework. I am trying to implement 2 pass z buffer algorithm. I have already done the first pass and created the depth map. However, the issue is that i rasterize my lines in screen space and so i have to bring my coordinates back to image space, as the comparison between z value of depth map and that of the fragment coordinates takes place in image space. I use a stack implementation which stores

XSL query inner xml

烂漫一生 提交于 2019-12-25 04:29:50
问题 Say this is my xml : <History> <University>TSU</University> <Payload> <Attrib Order="0">OVERSEA</Attrib> <Attrib Order="1">GRADE2</Attrib> <Attrib Order="2"><Person><ID>TQR344</ID></Person></Attrib> <Attrib Order="3">3566644</Attrib> </Payload> </History> And I want to query the inner XML inside Order=2 tag and read ID of the person. I have created this so far : <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="xml" encoding="UTF-8" indent=

How to apply transformation using 3x3 rotation matrix and a translation vector?

无人久伴 提交于 2019-12-25 03:38:29
问题 I am working on an Augmented Reality project using ARCore. Coordinate system of ARCore changes every time you launch the application making the initial position as origin. I have 5 points in another coordinate system and i can find 4 of these positions in Unity world space using ARCore Augmented Image. These points have different values in my other coordinate system of course. I have to find position of a 5th point in Unity world space using its position in other coordinate system. I have

simplifying a computation, so it could be done using matrix operations

空扰寡人 提交于 2019-12-25 01:55:40
问题 The basic operation I have is an operation on two probability vectors of the same length. let's call them A,B. in R the formula is: t = 1-prod(1-A*B) that is, the result is a scalar, the (1-AB) is a point-wise operation, whose result is a vector whose i'th element is 1-a_i*b_i . The prod operator gives the product of the elements of the vector. The meaning of this (as you could guess) is this: suppose A is the probability for each of N sources of a disease (or other signal) to have a certain

How do I stack the first two columns of a table into a single column?

故事扮演 提交于 2019-12-25 00:33:22
问题 I'd like to stack two columns of a table into a single column. So for example, if the source table is: | Id | Code_1 | Code_2 | Other | |----|---------|---------|-------| | 1 | Value_1 | Value_2 | Row_1 | | 2 | Value_3 | (null) | Row_2 | | 3 | (null) | Value_4 | Row_3 | | 4 | (null) | (null) | Row_4 | | 5 | Value_5 | (null) | Row_5 | Then the target table should be: | Id | Code | Other | |----|---------|-------| | 1 | Value_1 | Row_1 | | 2 | Value_2 | Row_1 | | 3 | Value_3 | Row_2 | | 4 |

Transforming a two-way table() into pairwise list of counts in R

这一生的挚爱 提交于 2019-12-24 23:25:22
问题 Starting with some sample two-way frequency table: a <- c(1,2,3,4,4,3,4,2,2,2) b <- c(1,2,3,4,1,2,4,3,2,2) tab <- table(a,b) > tab b a 1 2 3 4 1 1 0 0 0 2 0 3 1 0 3 0 1 1 0 4 1 0 0 2 I need to transform the table into the following format: goal <- data.frame(a=c(1,2,3,4),b=c(1,2,3,4),count=c(1,3,1,2)) > goal a b count 1 1 1 1 2 2 2 3 3 3 3 1 4 4 4 2 . . . . How can I form all pairwise combinations from the two-way table and add the frequency counts in the third column? Intuition tells me

Coordinates transformation

ぐ巨炮叔叔 提交于 2019-12-24 20:33:08
问题 I have two 3D objects in space and i want to copy the points from one object to another. The problem is that these objects don't share a common coordinate system and i have to do coordinate transformations. I have the local transformation matrix for both objects and i have also access to the world transformation matrix. I know there's some calculations to be done using these transformation matrices but i don't know how. How can i transform one point in the first object so that it has the same

Java transformation matrix operations

别来无恙 提交于 2019-12-24 16:18:48
问题 I'm trying to maintain and then use a transformation matrix for a computer graphics program. It's a 3x3 matrix that stores scale, rotate, and translate information for (x,y) points. My program can handle any individual case... i.e. if I only scale or only rotate it works fine. However, it does not seem to work when combining scale and rotate, and I think that has to do with how I combine rotation and scale in the code. The matrix is called transformation and is of type float. The following

R Error: unknown input format

穿精又带淫゛_ 提交于 2019-12-24 13:33:34
问题 NEI <- readRDS(unz(tf, filename = "summarySCC_PM25.rds", open = "", encoding = getOption("encoding"))) Variable tf is a temporary file with a very specific location saved on the hard drive. It is my understanding that the format for unz() is: unz(description, filename, open = "", encoding = getOption("encoding")) As I read the documentation, I am interpreting that my application of the code is accurate as that: description is a specific zip file destination, which outputs in var tf as c://...

MATLAB: How do I get 3D coordinates from a user-click?

僤鯓⒐⒋嵵緔 提交于 2019-12-24 13:32:55
问题 I'm using Matlab to create a small chess game for one of my courses this semester. The thing I'm having trouble with is having the user be able to select one of the chess pieces. To simplify things, I'm making it so that the user selects a piece by clicking on the square that the chess piece resides on rather than clicking the piece itself (which I assume would be much more difficult). I know how to get the x and y coordinates of the view-port, but how do I transform these coordinates into 3