transformation

iOS: Questions about camera information within GLKMatrix4MakeLookAt result

☆樱花仙子☆ 提交于 2019-12-06 05:11:11
The iOS 5 documentation reveals that GLKMatrix4MakeLookAt operates the same as gluLookAt . The definition is provided here: static __inline__ GLKMatrix4 GLKMatrix4MakeLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ) { GLKVector3 ev = { eyeX, eyeY, eyeZ }; GLKVector3 cv = { centerX, centerY, centerZ }; GLKVector3 uv = { upX, upY, upZ }; GLKVector3 n = GLKVector3Normalize(GLKVector3Add(ev, GLKVector3Negate(cv))); GLKVector3 u = GLKVector3Normalize(GLKVector3CrossProduct(uv, n)); GLKVector3 v = GLKVector3CrossProduct(n, u);

Remove XML comments using Visual Studio 2010 Web Config Transformation

こ雲淡風輕ζ 提交于 2019-12-06 04:37:14
问题 We are using Team Build to handle our deployments to our development server, and we have a need to remove comments from our web config when it's transformed. Does anyone know how to remove the <!-- --> comment lines from the web config file using a transformation? 回答1: I've found an answer. It seems this is a known bug in the XDT transformation engine in Visual Studio/Team Build. This bug was reported in March, so no idea when this will be fixed. Here's the link Edit: This link actually isn't

Web Services Versioning: Is ESB overkill?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 21:34:06
We have multiple versions of our web services (both REST and SOAP) in production, and the number keeps getting bigger with every release. Between versions, there can be minor changes (usually additions of new fields) to requests and responses. If we were to retire old versions, how could we continue to service requests for old versions? One aspect of a possible solution involves creating "virtual endpoints" to route requests for previous versions to the new versions of the same services. Thus, requests for /v1/customer/1 maps to /v2/customer/1. We are using Mashery through which this can

Raphael transform animation not behaving

狂风中的少年 提交于 2019-12-05 19:37:10
I'm doing an animated transform in Raphael (and Snap.svg, which does the same). If I apply a rotation to a basic element, it rotates normally as I would expect. However, if I already have a previous transform applied (even if its t0,0 or r0), the element seems to scale down and back up, as though it always has to fit in its previous bounding box or something. Here is an example fiddle var r1 = s.rect(0,0,100,100,20,20).attr({ fill: "red", opacity: "0.8", stroke: "black", strokeWidth: "2" }); r1.transform('t0,0'); // any transform leads to shrink on rotate... r1.animate({ transform: 'r90,50,50'

J2ME like Sprite on Android

旧巷老猫 提交于 2019-12-05 16:45:00
For my useless project of the month I'm working on a 'emulator' to run J2ME programs on Android. But now I'm stuck with the J2ME Sprite implementation. Specifically the transformations used in it. In my Sprite I have a bitmap with three character images. I would like to paint the second frame mirrored or rotated 90 degrees. What would be the best way for it? I have following code that paints the given frame without any transformations. frameX, frameY are frame position coordinates on give sprite bitmap. Rect src = new Rect(frameX, frameY, frameX + spriteWidth, frameY + spriteHeight); Rect dst

AST from c code with preprocessor directives

喜夏-厌秋 提交于 2019-12-05 15:24:44
How can I build an AST (Abstract Syntax Tree) from gcc C code in order to make some transformations, like below, and reproduce(generate) the code to C syntax again after that? if(condition_1){ //lines of code 1 } #ifdef expression_1 else if(condition_2){ //lines of code 2 } #endif into bool test = condition_1; if(teste){ //lines of code 1 } #ifdef expression_1 if(!(test) && condition_2){ //lines of code 2 } #endif GCC itself will build ASTs, but not before expanding the preprocessor directives. So the preprocessor conditionals are gone. Reinstalling them after you have done the transformations

Image transformation in C#

狂风中的少年 提交于 2019-12-05 15:19:48
I am working on a document processing application that generates and reads forms. The sample form attached is generated as a printed document, filled out by people, scanned and fed back to the application to detect filled values including Optical Marks (Bubbles), Text (OCR), etc. Click here for Sample Form . Since scanning distorts the image in terms of rotation, scale and translation, I use the three markers to detect orientation and correct the image in a rather primitive way that is VERY expensive on computation and memory. Here is the gist of it: Read in the image from disk. Detect bolbs

T4 Template containing XML results in parse errors

北慕城南 提交于 2019-12-05 14:01:32
I have created T4 Templates for the config files of my web and windows projects. I can successfully generate master web.config, and all configs for other environments, i.e. web.ci.config, etc..However, I could not get rid of the errors on my master tt files, such as : Character '#', hexadecimal value 0x23 is illegal in an XML name. Character '<', hexadecimal value 0x3c is illegal in XML attribute values. Unexpected XML declaration. The XML declaration must be the first node in the document and no white space characters are allowed to appear before it. I should be missing a xml schema or a

R: Insert multiple rows (variable number) in data frame

三世轮回 提交于 2019-12-05 11:05:37
I have a data frame with, say, 5 rows, for 2 observables. I need to insert "dummy" or "zero" rows in the data frame so that number of rows per observable is the same (and can be bigger than N rows for longer one). E.g.: # This is what I have: x = c("a","a","b","b","b") y = c(2,4,5,2,6) dft = data.frame(x,y) print(dft) x y 1 a 2 2 a 4 3 b 5 4 b 2 5 b 6 Here's what I'd like to get, i.e. add N rows per observable to 4. Mock up df x1 = c("a","a","a","a","b","b","b","b") y1 = c(2,4,0,0,5,2,6,0) dft1 = data.frame(x1,y1) print(dft1) x1 y1 1 a 2 2 a 4 3 a 0 4 a 0 5 b 5 6 b 2 7 b 6 8 b 0 I started with

Translate image by very small step by OpenCV in C++

可紊 提交于 2019-12-05 11:03:01
I'm doing image translation by very small step sizes (like translate in column by 1/1024) Consider I have the following image (I create the image with "Mat" in opencv and with the type CV_64F): 255 0 0 0 Now by doing translation in column by (1/1024) I would expect the following: 254.7509765625 0.2490234375 0 0 But what I get is the same source image!: 255 0 0 0 How can I get the expected result? Here is the code I'm doing the translation: Mat sourceImg = (Mat_<double>(2, 2) << 255.0, 0, 0, 0); double translateColumn, translateRow; translateColumn = 1.0/1024.0; translateRow = 0.0; Mat