Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 3
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 4762 times and has 2 replies Next Thread
mazoola
Advanced Member
Member's Avatar

USA
Joined: Mar 25, 2015
Post Count: 153
Status: Offline
Reply to this Post  Reply with Quote 
Using 'Copy as new furniture' to improve texture mapping

All -

When working on my ongoing home redesign project, I stumbled across a neat little trick that improved how sh3d mapped textures to some of my objects, and I thought I would pass it along. Caveat: it's not a universal solution, and I'm not conversant enough with Emanuel's texture-mapping rules to predict when it will or will not help -- but it's simple enough to try and see.

While modeling the kitchen for that project, I needed an irregularly shaped kitchen counter-top with a rectangular knockout for the sink. Today, I'd quickly pound one out using Sketchup, but at the time I was even less familiar with that program than I was with sh3d. What I did instead was to create the counter-top as a very short wall (actually, two very short walls, one sloping) and use an invisible box imported as a door/window to knock out the space for a sink I found in the Sketchup 3d Warehouse. I then mapped a seamless granite texture to the wall, exported the counter-top as an OBJ model, and re-imported it as furniture, changing its orientation from vertical to horizontal. After I remembered I needed to take into account floor thickness in calculating the resulting wall height, everything worked fine.*

There are actually three separate counters in the finished kitchen, two of which are rectangular, and for those two I simply scaled a six-color box to the desired size and mapped the texture onto each side. Around this time I became dissatisfied with how frequently the texture repeated itself, which effectively eliminated any value to its being seamless, so I warped the original image file into a 4x larger seamless texture. Although when mapped against the rectangular counters it still repeated noticeably, it didn't do so as obviously as the smaller texture did.

However, when I applied my new, larger texture file to the irregularly shaped counter model, sh3d simply replaced each instance of the original image with an instance of the new one, reduced to fit. For instance, in the following image the left-most counter-top is the original object; the second counter-top is the original object with a higher-resolution texture file applied using the 'Materials' option. (That is, under 'Color and texture' in the 'Modify furniture' window, I selected 'Materials'; in the 'Furniture materials' window, I selected 'texture' and chose the higher-resolution granite texture from the library.)


Well, I thought, I'll just map the desired texture against the entire object, rather than replacing the original granite material with the new one. Unfortunately, since I had changed the object orientation from vertical to horizontal during the import process, the texture now mapped against the object's new vertical face: the counter's front edge, as shown in the third counter-top in the preceding image -- not quite what I had in mind, either.

I screwed around for a while, trying to figure out how to trick sh3d into mapping the next texture as I wanted it to -- including, if memory serves, some unproductive monkeying about with MTL files. Finally, though, I had the bright idea to export the object once again using the 'Copy as new furniture' plugin. I then pasted this 'new furniture' object into my plan in place of the original counter-top and mapped the higher resolution texture against it using 'Texture' under 'Color and texture.' This gave me exactly what I wanted: The same mapping against the irregular counter-top as I had achieved against the rectangular ones, as shown in the fourth, right-most counter-top in the preceding image.

Note this maps a two-dimensional texture against a three-dimensional object, which means some sides of the object may not display as desired. (See this comment and the referenced threads for more information on sh3d's mapping algorithm.) The following image illustrates this, with counter-tops from top to bottom corresponding to those listed R to L in the first image.


__________
* That is, to get a 2′ deep counter-top using the default floor depth of 4¾″, I needed to define the wall to be 1′7¼″ tall. Since my cutout needed to be nearer than 4¾″ to the counter's edge, in reality I reduced the floor thickness in preferences to the desired spacing, created and exported the wall, and returned to the default thickness.
[Jun 1, 2015, 10:23:02 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9426
Status: Offline
Reply to this Post  Reply with Quote 
Re: Using 'Copy as new furniture' to improve texture mapping

Nice try smile
But I think there's an easier way to get the counter-top you wish using an elevated room, because a texture along the thickness of a room is applied the same way it is on an object (i.e. it's nice on the front face). If you import an invisible box as a staircase, place it at the lower level and make it higher than the upper level, this will create a hole in the upper room for the sink. Then, you just have to export to OBJ format the room + the invisible box to get an importable counter-top.
Please see attached file.
----------------------------------------
Attachment KitchenCounterTop.sh3d (89772 bytes) (Download count: 619) (Counter-top built with a room and an invisible staircase)

----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
[Jun 1, 2015, 9:03:43 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
mazoola
Advanced Member
Member's Avatar

USA
Joined: Mar 25, 2015
Post Count: 153
Status: Offline
Reply to this Post  Reply with Quote 
Re: Using 'Copy as new furniture' to improve texture mapping

Oh, almost certainly there are other and/or easier ways to accomplish this -- remember, at the time I had no idea how to create a non-rectangular solid *except* as a knocked-over wall. (However, I actually *did* do something similar to this by exporting a wall-less room in OBJ format. I'm not sure why, though -- possibly I was trying to create recessed lighting 'cans' in a dropped ceiling, until I decided that was a little *too* anal, even for me.... I don't know why I didn't apply the technique to creating the counter-top; most likely I didn't come across this idea until after I had the counters done.)

Still, I've used this same technique a couple of other times to let me map textures differently than I otherwise could, so its utility isn't limited to goofy wall-based kludges! wink
[Jun 1, 2015, 11:50:09 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

  Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads  
© Copyright 2024 Space Mushrooms - All rights reserved