User Tools

Site Tools


wax_head_by_hal

Tutorial: Scanning a wax head

by Mattia Mercante – mattia.mercante@gmail.com

Please feel free to correct this text. The author is no native speaker. Thanks.

Introduction

Hello “Davidians”, in this tutorial I will try to example a way to obtain a cleaner and lighter mesh from DAVID 1.5 + Shape Fusion. I’ve used ZBrush for re-topology (www.pixologic.com), 3D Studio Max for mapping (www.autodesk.com) and Photoshop (www.adobe.com) for final photo merging. Instead of these software you can use others, like Blender 3D or gSculpt (as ZBrush re-topology tool) or other 3D editors. Instead of Phoposhop you can use one of your preferred 2D editor, but it must have the possibility to create many layer in the same file. This is a translation from my Italian tutorial: I’m sorry for the image’s text, it’s in Italian, but I explain it all in the tutorial’s text. Here we go: come on!

foto_00.jpg

Hardware Setup

IT’S SCANNING TIME, WITH DAVID Equipment:

  • CCD or CMOS camera with WDM drivers (I use CCD WebCam “WB Trust 5400”, 25 €);
  • Laser Line generator (I use a Black&Decker laser leveler, class 2, power 3mW, 30 €);
  • Background corner (for calibration and scanning).

You can use a webcam with minimum 640×480 resolutiom at 15 fps; anything under that will be hard to work with. Instead of the classic 90° angle I have used a modified system. My way is: a scan panel calibration system with removable calibration corner. We calibrate the camera only one time and it is possible to move the camera around the object. In the photos you see the webcam attached to a wooden T-shaped structure; panels are oriented at 90°. For any problems read DAVIDs manual. For example, if you have an immovable object this set-up facilitates moving the camera around the object without recalibration. See the picture below.

Let’s start: choose your system (standard, windowed- see “windowcorner” in forum – or my mixed system) and build it. If you choose mine, you must be precise in building the 90° calibration corner and scan panels. Together they must add up to an accurate 90° calibration corner, such as the standard method. You must be very precise. With my method, the calib-corner is moveable: you can put it between scan-panels (see picture here).

Print your markers and attach them on calib-corner (be sure that its surface is perfectly flat and clean; use adhesive instead of glue, because glue can deform the paper). Put your object in front of the panels or between them.

Calibration

Open David and start the calibration. Choose your webcam in the “Choose camera” list. It’s very important to measure the length of the line named “scale” on the printed markers. Use that length in the “Scale of calib. Points (mm)”, of the “Camera Calibration” window.

After this, adjust the “Camera Settings” to obtain a clear view of markers. If you see something in the white area that is not a calibration point, use the “Eraser” tool and erase all visual noise. Point the mouse in the view field, click the left button and drag to erase. You should see only markers. If you accidentally erase a marker by mistake, correct it with LMB (left mouse button).

Go to camera setting, create a bright and contrast image. Click “Calibrate Camera” and, if everything is correct, red crosses appears on the video over the markers. If the crosses do not correspond to the markers, you must try again. Read the user manual. When calibration is finished, click “Next”.

Scanning

Now your goal is to capture the laser line. You will be brushing on the object. To do this, change the camera settings decreasing brightness and increasing contrast, sharpness and gamma. Don’t forget to turn off the ambient light (or just reduce it). You should have a camera view were the only thing visible is the laser line.

In the second image the correct position of the laser is visible. Keep a min. 30° angle. Anything below that, David might show this error message: “angle intersection too low”. This happens because David read the line on known planes (calibrated) and then triangulate its position, pixel per pixel. Before scanning, tell David what color laser you are using: if you have a red laser (very common) its checker must be marked. With “grab texture” you can capture an image frame from the camera and use this for mapping the mesh (for this acquirement you must see cleaning the object). A tip (for color webcam): in camera settings, change to black and white mode. It can reduce the noise during scan. If all is good, click “Start” and brush the laser line over the object, VERY slowly. You can move your laser by hand or, better by fixing it on tripod or something stable and who permitting the rotation along an axis. You scan by moving the laser up and down in a brushing motion, keeping the line horizontal to the scan panels. The camera must see a line on both scan panels or you will get an error. Change its position, left and right, to reduce the shadow. I’ve scanned little stylized head of Karl Marx. Its made with natural yellow wax. I was testing the strength of David’s architecture. Wax has many problems with light, generating artifacts. Sub surface scattering diffuse the light in the wax, and David could fail in accuracy. But I was pleasently surprised: the program is strong and read my surface nicely, only generating little waves. When you finish, you should obtain results similar to these.

In the “3D Laser Scanning” window appears a grayscale depth image: this is your raw 3D object. A points cloud that can be interpolated and smoothed with buttons in “interpolation & filtering” box. If you have any problems during a scan, press “Pause” and retry, if you encounter an error and your image appear distorted, press “Erase” and start again. Be patient, it’s a slow step and requires precision. When satisfied, click on “Show 3D” to see the mesh: David is a wonderful program and has a nice 3D viewport for interactive navigation of your scans, using your mouse (center wheel of mouse for zooming, right click and drag for rotating). Here is a list of what the buttons across the top do: center the mesh in the view, on/off wireframe view, on/off normal view, on/off texture, change lights sources in scene, see the shortcut’s quick help. Scan many times, scan every side of the object to obtain a 360° model. With my camera/panels system, you can move the camera around the object, but if you are using classic panels, turn the object. Important: if you want to assemble two or more scans, keep in mind that ¼ of every mesh must overlap the other.

Save your scans as .obj file, one by one (tip: if your scan is good, don’t interpolate or smooth, I will explain why later). Now it is time for Shape Fusion. Click “Next”…

Shapefusion

…with “Add” load, for example, two scans, for alignment. When loading, a message appears with aelection of “bad” triangles or outliers. Make your choice and mark in red the part of the mesh that you want to eliminate. Do this and press “Align”, follow the rules: select first mesh and then the second. If alignment works on “Free align”, the first mesh will be aligned to the second. At the end a “Fine registration” is displayed. When all is done, fuse scans with appropriate buttons. Test many set-ups and resolutions. I work with “Poisson” at “512”. Here the final result in David. Save as .obj.

Postprocessing

My model count was 1.200.000 polygons! Now I must reduce its geometry, using a re-topology tool.

Re-topology using ZBrush

Open ZBrush (from version 3.0) and click “Import” in the “Tool” menu. Select your .obj file and click on the canvas (working space in ZBrush, your viewport). Drag and drop the model. To align it, click in the empty space of canvas and, keeping pressed LMB, drag +SHIFT. Your job, now, is to import the mesh into the program, only for the next step. Erase from canvas the mesh with CTRL+N. Start the work creating a ZSphere: it’s a virtual null object who can be used for creating polygons ON your object. In the “Tool” menu select the double-coloured red sphere called zsphere. Drag and drop on canvas, then press T on your keyboard. Doing this, starts “edit” mode. The way is simple: in “Tool”, at the end of this menu, search “Rigging”, “Select mesh” and select your object which you imported in the last step. Below “Rigging” find “Topology”; open and press “Edit Topology”. Now create, on yours high poly mesh, your low poly mesh, click by click. Simply pressing LMB on imported object and creating, vertex by vertex, your polygons (tip: create only four edge polygons). Click eatch time on David’s mesh. To close the polygon, create the fourth on the first. In big and homogeneous surfaces you can create a low number of polys, when particulars are present, like curve, edge or fine particulars, you must create many poligons. See the images to understand.

To preview your works, press A. If ZBrush create many subdivisions for each polygons created, in “Tools” menu, open “Adaptive Skin”, decrease “Density” to 1. To erase bad vertex, click on it with ALT+LMB. At the start this can be hard work, long and boring. Be patient: with little practice you can do this in little time. When finished, save your project as .obj (“Tool”, “Export”).

The topology step is now finished: congratulation! Now you start a new job: mapping in 3D Studio Max, with its tool (modifier) Camera Map. Take a break, or your eyes will be burning!

Texture Mapping using 3D Studio MAX

First of all, if you have not already taken necessary photos of your object, you can do so now with a good camera,. Use a diffuse light, same dimension and resolution for each photo. Save as bitmap file, as .jpg for example (tip: take good photos, but not so big, in Mb size).

Open 3D Studio Max and Import your low poly ZBrush .obj using “File – Import”. In Top viewport create a Camera (“Create” menu in the right side of the workspace). Center its target, moving with the “move gizmo” (M), in the mesh. See second upper image. This is the way: project, with a camera, the image on our model and, in the same time and camera, see it in the background. With this system you can match the images by hand. “Camera Map” modifier has only one problem: it does not generate UVs map coordinates. We fix this problem using the implemented tools, created for videogame development: “Render to Texture” features. With this tool it is possible to unwrap the UVs mesh topology and merge on it the photos, correctly and quickly. But we must proceed step by step. With the low poly mesh opened, select it and apply the “smooth modifier” and enter “90” as angle threshold value (right side of viewports, modifier list). Now you have a smoothed object and seams between polygons are invisible. The shape now appears homogeneous. Select one viewport and click RBM on viewport label; in “Views” select your camera. In the view field you see through the camera. Aim at your mesh. Press ALT+B pointing mouse on viewport background: “Viewport Background” window appears. On “Files” select an image, a photo of your real object. Check its dimension opening “Info” box. Press “Open” and, in “Viewport Background”, mark “Match Bitmap”, “Display Background” and “Lock Zoom/Pan”. Pressing “Ok”, your image becames visible in background. Press F10 and, when “Render Scene” menu appears, in “Aspect Ratio”, match “Width” end “Height” using your photo’s dimension.

Close this window and, on viewport’s label, click RMB and check “Show Safe Frame”. Now the image in background is proportioned. Select the mesh and apply on it, from the modifier stack, “Camera Map (WSM)” modifier, in “World Space Modifier” group.

Modifier will list in object’s stack. After then, open material’s menu (press M). Select a free slot, in “Diffuse” box, choose “Camera Map Per Pixel”. Appears “Camera Map Parameters”. In “Camera” field, select your camera in the scene, in “Texture” box choose the same image that you used in background. Set “Angle Threshold ” at “80” approx. Render scene to understand.

Now adjust the “image projected on mesh” moving and sets parameters of camera, live FOV, Lens, prospective deformation, … . To see clear your texture, in material menu, at “Basic Parameters”, insert “100” as “Self Illumination” value. Find your best match and, as viewport wireframe mode (F4), overlap 3D object to the photo. Be patient and do this with care. When finished proceed to UVs creation. Select your object and, in stack, select the first label “Editable mesh”, below “Camera Map Binding” modifier. Now press 0 on keyboard: appears “Unwrap Only” window. Do nothing and only press “Unwrap Only”. In the object’s stack appears “Automatic Flatten UVs”. Double click on it to enter in the sub-level selection level. Select “Faces”, after CTRL+A, to select all faces. Press “Edit” in “Parameters” field. Your goal is set correct UVs coordinates. With all faces selected, press “Cylindrical” in “Map Paremeters” menu. A yellow cylinder appears, warping your object.

In “Edit UVW” window your mesh is layed out like an expanded cylinder. Adjust it, using “Relax” tool, in the “Tool” menu. To keep the proportion between every polygons, setting up 25 as value for “Relax by Edge Angle”. After play “Relax by Center” but before mark “Keep Boundary Points Fixed”. To check out your work, in selection panel choose “Select Inverted Faces” and “Select Overlapped Faces”. If nothing appears in red, all has gone well. To exit from “Faces” sub level, simply double-click on it. Now you can export the projected photo as a UVs aligned bitmap. Return in “Render to Texture”, choose “diffuse” in render elements, set a name, type and dimension for saved image, then press “Render”. Repeat the projection step and this latest step for every single photo. Good luck! (tip: when you save each images, change the name of image in render to texture window or you will overwrite your previous one).

You obtain an X number of image. Now merge them in 2D editor, like Photoshop. Open all and import. Create layers in one of this files having a total of the number of images from 3D Studio Max. Fuse them to obtain a homogeneus, unified color map. Open again your low poly mesh in max (or other 3D program) and apply your final color map in the diffuse color material’s slot (mesh must be the same who you have unwrapped, with UVs coordinates).

The End! Congratulation: now you can use yours model in yours projects. Below my others scans, ready to play.

Many thanks to CARL, FILIPPO and SHIRIN. Thank you, my friends!
And special thanks to Greg “Bongobat”. Thanks to Simon for the headings.

wax_head_by_hal.txt · Last modified: 2014/06/06 18:38 (external edit)