## projection

### Hibernate Query By Example and Projections

Hi all, To make it short: hibernate doesn't support projections and query by example? I found this post: The code is this: User usr = new User(); usr.setCity = 'TEST'; getCurrentSession().createCriteria(User.class) .setProjection( Projections.distinct( Projections.projectionList() .add( Projections.property("name"), "name") .add( Proj...

### 3d to 2d Projection Matrix

I have 3 points in 3d space. I know the exact locations of them. Suppose they are (x0,y0,z0) (x1,y1,z1) (x2,y2,z2) Also i have a camera that are looking at these 3 points and i know the 2d locations of those three points on camera view plane. So for example (x0,y0,z0) will be (x0',y0') and (x1,y1,z1) will be (x1',y1') and (x2,y2,z2) wil...

### 3D effects in a 2D game using OpenGL

Hello! I am working on a 2D game using OpenGL ES. I am using the orthographic projection, since it makes the 2D stuff easy. Now I would like to create a simple 3D effect, say rotate a sprite around the Y axis (something like cover flow). If I understand things correctly, this can’t be done in the ortho projection. Is it possible to do it...

### Calculating a LookAt matrix

I'm in the midst of writing a 3d engine and I've come across the LookAt algorithm described in the DirectX documentation: zaxis = normal(At - Eye) xaxis = normal(cross(Up, zaxis)) yaxis = cross(zaxis, xaxis) xaxis.x yaxis.x zaxis.x 0 xaxis.y yaxis.y zaxis.y 0 xaxis.z ...

### Projections.RowCountInt64() returns 0 when i set SetFirstResult

rowCount returns 0 when query.SetFirstResult is different from 0 ? if the result of pageIndex x pageSize = 0 // it gives me the rowCount but when it is not equal to 0, countCriteria gives me 0 instead of rowCount. What can i do ? Thanks in advance ...

### Lens correction projection

What is the simplest way to un-warp a photo made using fisheye or wide-angle lens? I'm looking a pixel projection formula that has few parameters. Camera and lens parameters will not be known, so user has to change the parameters visually. Thanks ...

### How can I find the 3D coordinates of a projected rectangle?

Hello everybody. I have the following problem which is mainly algorithmic. Let ABCD be a rectangle with known dimensions d1, d2 lying somewhere in space. The rectangle ABCD is projected on a plane P (forming in the general case a trapezium KLMN). I know the projection matrix H. I can also find the 2D coordinates of the trapezium edge p...

### flash 10 orthographic projection

I've been playing a bit with the new flash 10 3d possibilities, and found out that rotating a sprite in 3d is fairly easy: var card:Sprite = new MyCard() card.x = 100 card.y = 100 card.z = 200 card.rotationX = -60 addChild(card) Simple and effective, this shows the card rotated with perspective. Now I want to use an orthographic proj...

### Formula for a orthogonal projection matrix?

I've been looking around a bit and can't seem to find just what I"m looking for. I've found "canonical formulas," but what's the best way to use these? Do I have to scale every single vertex down? Or is there a better way? A formula would really help me out, but I'm also looking for an explanation about the near and far z planes relativ...

### Perspective Projection - Help a Noob

Hey, I wish to determine the 2D screen coordinates (x,y) of points in 3D space (x,y,z). The points I wish to project are real-world points represented by GPS coordinates and elevation above sea level. For example: Point (Lat:49.291882, Long:-123.131676, Height: 14m) The camera position and height can also be determined as a x,y,z poi...

### NHibernate Projection to DTO

Hello, I am unfamiliar with NHibernate projection. I am attempting to use it so I can return a List<> rather that an IList<>. I am not having much luck with projecting to the DTO as of yet. I have the following query and Domain objects. So to begin I am just trying to get a list of Orders given an EmployeeID. I am looping through the re...

### How to apply a transformation matrix?

Hey, I am trying to get the 2D screen coordinates of a point in 3D space, i.e. I know the location of the camera its pan, tilt and roll and I have the 3D x,y,z coordinates of a point I wish to project. I am having difficulty understanding transformation/projection matrices and I was hoping some intelligent people here could help me alo...

### Projecting aggregates together with Entity using NHibernate

I have a pretty standard Orders table and an associated OrderRows table, say: Orders [id] INTEGER [name] ... OrderRows [orderId] INTEGER [quantity] INTEGER [unitPrice] SMALLMONEY [description] VARCHAR(...) For some situations I would like to retrieve a list of Orders together with a summary of totals, most of the time I don't care fo...

### NHibernate projection help

Hello there, Im having a problem creating a projection for my nhibernate detachedcriteria object. I have a class Spa which is linked to table Address. Address has a field called City which is a string. public class Spa : IAggregateRoot { [BelongsTo("AddressID", Cascade = CascadeEnum.All)] public Address Address { ge...

### Using Projections on Formula Properties

I have a property in my XML mapping file like <property name="CreatedByLogin" formula="(select x.fst_name || ' ' || x.last_name from sebl_dev.S_CONTACT x where x.ROW_ID=CREATED_BY)" type="String" /> and I want to use a projection on this particular name like .Add(Projections.Property("CreatedByLogin"), "CreatedByLogin") and I do g...

### scala Map filterKeys: Projection cannot be assigned to a Map reference

The following code: var m: Map[String, Int] = Map("A" -> 1, "BB" -> 2, "CCC" -> 3) m = m filterKeys { s => s.length < 3 } Does not compile. I get the following error: error: type mismatch found: collection.this.Map.Projection[scala.this.Predef.String,scala.this.Int] required: collection.this.Map[scala.this.Predef.String,scala...

### LINQ to SQL and Data Projection, MVC

HI I have a table with some some values (IDs), and of course when i get the result i got just the int IDs, but i want to put it more user friendly, for example when its the number 1, i want to put the string "Avaible", when its 2 "Not avaible", im on an N tiers enviroment and i need to get this done on the Model, whats the best way to a...

### 2d outline algorithm for projected 3d mesh

Hi, Given: A 3d mesh defined with a set of vertices and triangles building up the mesh with these points. Problem: Find the 2d outline of the projected arbitrarily rotated mesh on an arbitrary plane. The projection is easy. The challenge lies in finding the "hull" of the projected triangle edges in the plane. I need some help with inp...

### Can I merge Syntax coloring and Folding? OR Projection colored from master document info

Example. I have an XML document: <document> <region type="type1">text of region1 </region> some simple text <region type="type2">text of region2 </region> And I want it to be presented as text of region1 some simple text text of region2 The basic Eclipse coloring works independent from folding, as I know. But I need text to be c...

### true isometric projection with opengl

Hello, I am a newbie in OpenGL programming with C++ and not very good at mathematics. Is there a simple way to have isometric projection? I mean the true isometric projection, not the general orthogonal projection. (Isometric projection happens only when projections of unit X, Y and Z vectors are equally long and angles between them a...