UV mapping error using project from view

Using v2.66.5 r55765.

Followed Andrew Price’s camera mapping tutorial, got stuck projecting from view. Doesn’t matter how many times I subdivide, it just doesn’t want to map the face(s) to UV correctly. The UV coords are distorted, not the right scale, and not in the right place.

Also, how do I clear UV coordinates from a material?

Check that your object scale is 1. Scale is on the properties panel (N) in object mode and you can apply scale with ctrl+a -> scale.
UV map list is in the object data properties (lower down in the pic)

The object was already at scale: 1, but I applied scale anyway. No effect.

However, I did find scaling the UV for that series of faces got it close, but I don’t know why its behaving that way. The other faces do not have that problem.

If you upload your .blend, could check that and perhaps find the culprit.
If you want, you can also pack the image to the .blend from file menu -> external data -> pack into .blend. Or, if you already have lots of images loaded, pack just the bg image in the UV/image editor by selecting it from the list and then Image menu -> Pack image.

Try one more time subdivide mesh at first.
What you see on the upper part is repeated texture’s lower part - street. You could make image bigger and photoshop in upper part of the building to get it more correct. Or add Mapping node and set Clipping on.

Well, I guess other objects exhibited the same problem too. sigh

A little history on my journey:

I started with BLAM, but failed to solve for the virtual camera parameters due to multiple vanishing points from image distortion. Based on the photo time period, I could have searched for known cameras and tested lens parameters, but I opted to manually undistort the image.

  1. loaded image into Gimp
  2. rotated for horizon
  3. traced known vertical and horizontal lines to find distortion
  4. ran lens distortion filter to straighten distorted lines

Even though I still failed to solve for the exact camera location, it is much better. Since my goal is to move the camera angle slightly to render an image for a painting reference, this is close enough. If I could, I’d get it exact.

The .blend is attached.


sf-street.blend (691 KB)

Look at the lines receding to the vanishing point. On the 3D (right) image, the plane edge is aligned to the image curb. On the 2D (left), it is skewed and repositioned. Other than the render size which is matched to the image size, Is there an aspect ratio I need to check? I can’t think of anything else that would repeatedly cause this with all geometry.

Spoke to some chaps in #blender @ irc.freenode.net. One of them pointed out that Andrew had to unwrap, remove and reload the UV image to get the UVs to snap to correct place. That worked for my first object, but the following objects not so much.

Another chap said he had a job doing 3D mapping and had this problem consistently. His solution was for a friend to write custom code for their particular camera so projecting would work correctly. In other words, it’s a bug - or rather, it is if using the Cycles renderer, not Blender Internal.