Planar Textures: 3D Objects & Walls | WCS 6 · VNS 2
| Many users don't have an application for building 3D models with UV-mapped textures. For simple models, textures can easily be applied in VNS. However, you can't just slap any texture on a model surface using defaults and expect it look right. You have to tell VNS where and how to apply the textures. Even if you use UV-mapped textures on your 3D models, it's important to understand how planar textures work because you'll use them on Wall Components. 1. As always, create a simple and fast-rendering project when you're trying to figure out how a feature works. Use the Terrain Generator to create a flat 1-hectare DEM with a 10-meter grid. Name the project something like Flat and save it as-is for future exploratory flights in VNS. 2. Add the Terrace House 3D Object Component from the Component Gallery, placing it at the center of the DEM. 3. We'd like to see the side of the house too, so change the 3D Object's Rotate Y (heading) value to -45º. Zoom and rotate the perspective camera to fill the view with the house and render a preview. (You can change the Ground Effect Diffuse Color to green if you're in the mood.) 4. The Terrace House 3D Object has a 4 materials: Door, Roof, Walls, and Window. Increase the Walls Material Luminosity to 50% to make it easier to see in shadow. 5. Let's apply an image texture to the Terrace House Walls Material. This one is wall_peak.jpg in your Components\Image\Tutorials folder. 6. Create Texture for the Diffuse Color in the Walls Material Editor. 7. Change the Selected Element to Planar Image, add New Image Object and select the image, and change View From to Cube. 8. Render a preview. The Walls render black where there is no texture. We can't see the texture because it's too small and in the area occupied by the Door material. 9. Rule 1: Know Your 3D Object. The texture's Center is relative to the 3D Object center in Object Cartesian Coordinate Space. The Texture Axis is perpendicular to the texture plane and coincides with the 3D Object axis. (Remember that 3D Object axes aren't all the same as terrain axes.) If you haven't done it already, check the 3D Object Editor. The Terrace House is about 7.6 m high (Y axis), 5 m wide (X axis), and 8 m deep (Z axis). The center of the object is just above the floor. 10. Meanwhile, back in the Texture Editor, The default size of the texture is 1 m x 1 m x 1 m and the center is at 0, 0, 0. Increase the Size values to 5 m and render a preview. 11. The texture is larger but we only see the top half because it is centered on the Z axis of the object (ground level). 12. Increase the Center Y value to 2.5 m and render a preview. The texture has been raised 2.5 m and its base now coincides with the base of the house. 13. We want the texture on the side of the house, perpendicular to the X axis. We could rotate the texture but the cleanest solution is to change the Texture Axis to X. 14. Now that we understand what texture Size and Center do, we can Size to Fit. We could have tried this initially but Size to Fit without understanding what Size and Center mean will only cause confusion down the road. Note that the Size and Center values have changed. 15. This render illustrates a common problem with 3D Object textures: the texture is not appropriate for the model. This house was originally modeled with a single Walls Material for simple color or procedural textures. It works great for that, but not for what we're doing. 16. Replace the house with TerraceHouseTute from the Tutorials page of the Component Gallery. Link the materials when prompted. Rotate the object and increase the luminosity of the two wall materials as you did in Steps 3 and 4. 17. This model has separate materials for the front and sides of the house. Use what you've learned to create planar image textures for the wall materials using the following images and texture axes.
Material | Image | Texture Axis
Walls_Front | wall_rect-frt.jpg | Z
Walls_Side | wall_rect.jpg | X
18. Let's look at the Window material. We'll apply the window.jpg image to it. 19. Create Texture for the Window Material Diffuse Color. 20. Change the Selected Element to Planar Image, add New Image Object, and select the window.jpg image. The front of the house is perpendicular to the object's Z axis; select that as the Texture Axis. Render a preview. 21. The windows are black, just as we expected. The default 1-m³ texture image is rendered with its center at X=0 and Y=0, which is the location of the Door material. 22. Size to Fit the texture. The texture has been sized across the entire area of the two windows, including the wall between. 23. Size to Fit will get us closer to want we want. Select Tile Width and reduce Size X to 0.7 m. The size reduction gives the rendered texture the correct height-to-width ratio and Tile Width repeats the texture sideways. 24. That's enough for 3D Objects. Now let's apply our new understanding of planar textures to a Wall Component. Create a Wall Component with 3 vertices south of the house and increase the Panel Top Height to 2 m. 25. Increase the Wall Panel Material Luminosity to 50% to make it easier to see the texture we apply when it's in shadow. 26. Let's apply the fence.jpg image texture to the wall. The image represents an area 1 m wide and 2 m tall. 27. Create a texture for the Wall Panel Material Diffuse Color. 28. Change the Selected Element to Planar Image, add New Image Object, and select the fence.jpg image. We want the texture to wrap around the entire Wall. That means we need to place it using the Vector Aligned Coordinate Space. 29. In Vector Aligned Coordinate Space, the Y axis parallels the vector and Wall, the Z axis is vertical, and X is perpendicular to the Wall formed by the vector. You can see that the X axis will be our texture axis. 30. Change the Texture Axis to X, Size Y to 1 m, and Size Z to 2 m. 31. By default, the center of the texture is Y=0 and Z=0, which is the start of the vector at the first vertex. In my project the Wall vector points were clicked left to right. 32. To check your point order, open a planimetric camera view and select your Wall vector in the Database Editor to activate it. Click the Select/Show Points tool button from the toolbar to make the Wall vertices visible. 33. Open the Vector Editor to the Selected Points page and select Single Point under Points Selected. The first point will be selected in the real-time views. 34. With this texture we don't have to worry about its center because we're going to repeat the image horizontally and vertically. Tile Width and Height. |
Copyright 2007 R Scott Cherba All Rights Reserved |