How to Make 3dsMax Object from Transparent Picture (.png)? - png

Let's say I create a transparent image (without background) via Photoshop from the geometry I draw, and saved it as "png" file. I would like to shape 3dsMax object, i. e. plane according the geometry of my drawing from "png", and then extrude it in the case to have 3D object (but not necessary, only shaped plane can be enough for some projects). How to shape 3dsMax plane following the path of the image in "png"? Is there any converters?

So, basically, after the modifications via Photoshop I opened "jpg" file in Adobe Illustrator (it is possible to open .psd files directly), and made a path there:
Object>Image Trace>Make
Object>Image Trace>Expand
Delete picture frame anchor points.
Choose Colors (right panel), Swap Fill and Stroke (left panel).
Then I saved as .ai file (Illustrator 8 version is fine for 3dsMax 2009), finally, imported into 3dsMax (File>Import...), and have their that shape.

Related

Do you know how to do an inverted mask/shader or any other way to see onlu part of an object within a sphere boundary in Unity?

Cut out sphere
What im looking for it this exactly behaviour but what i need is that is compatible with URP, as you may see im just starting with Shaders
could you give me any guidance on how to update this to URP?
i have look up for stencil shader / cut out / Buffer
i have replicated the portal stile ones but i need the object to be able to grow like a tree but if its outside the sphere should not show
You can do it with Sphere Mask node :
And link Out to the Alpha property (if your Surface Type is set to Opaque then, check the Alpha Clipping in your Graph settings).

Swift SceneKit Diffuse color doesn't change anything

I have a 3D model in .obj form and a corresponding .mtl file.
I dragged them both into xcode and converted the .obj model to a .scn file.
Xcode loads the file correctly and also applies the material. So in diffuse there is a color. (See image below) The problem is: The model stays white, except if I add an emission color. (See the two attached images - one with and one without emission color - once the model is visible and the other time not)
How do I apply the material color correctly?
Assuming the first image shows the result you don't want and the second image is a result more or less good, I can tell you this: The emission color of the first image is set to a pure white, which means, the emission is set to its maximum, what makes it almost invisible on white backgrounds. the second image just has some emission (a gray color) and so the geometry becomes better visible.
If your geometry is not a lamp and neither a light source, set the emission color to UIColor.black, and your object should be just fine.

How to draw animations of feathered/blurred stroked paths

In this thread I asked how to create animations of blurred-edged filled paths, to create a "circle wipe" animation with feathered edges.
The solution is to install the path in the shadowPath property of a layer an animate that. Core Graphics applies a variable amount of blur to the shadow path, and the shadowPath property is animatable. However, it fills whatever path you install into it. You can't use it to draw feathered/blurred stroked paths, since what gets rendered as the shadow is a closed, filled version of whatever path you install.
There is a method copy(strokingWithWidth:lineCap:lineJoin:miterLimit:transform:) that will convert a stroked path into a closed path that traces the outline of the stroked path. If you fill the output of that method, you get what looks like a stroked version of the original path. You can install that converted path into the shadowPath of a layer and get a nice, blurred stroked path.
However, under the covers, the copy(strokingWithWidth:lineCap:lineJoin:miterLimit:transform:) method does some things that make the resulting path unsuitable for path animation. If you look at Rob Mayoff's excellent answer in this thread, you see that for inside corners, Core Graphics creates odd triangles that overlap with the interior of the stroked shape. It also seems to sometimes vary the number of vertices in the output of the path depending on it's shape.
For paths stroked with a fairly thin line width, they animate well. Here is an example:
But when you increase the line width and/or blur radius, things go "all pear-shaped" (meaning they go very wrong.) Here is an animation of the same curve with different settings:
You can see the project that generates these images on Github, and try it yourself.
Question:
Does anybody know of a way to convert a stroked path to a filled path that does not have the artifacts described in Rob Mayoff's post?
If I have to I can write my own version of copy(strokingWithWidth:lineCap:lineJoin:miterLimit:transform:) that creates a filled path with a fixed number of vertexes and without the artifacts that method creates, but it would be pretty involved. I'm hoping there is an existing solution.

How to mask a UI.RawImage in Unity?

In Unity UI, I have an ordinary RawImage
(It's just sitting on a Panel)
I have a png, mask.png which is just a white shape on transparent.
How do you mask the RawImage ?
I have tried Mask, SpriteMask in many ways and it just won't work.
Even RectMask2D would be fine (to mask to a square shape) but it just doesn't seem to work?
Should I use Mask or SpriteMask
If so, do you perhaps have to / have to not set a Material, on the mask? On the RawImage?
I assume the Mask game object should be the parent of the RawImage, but??
What is the secret ?
The RawImagecomponent should work with masks just like your normal Image component does. Granted that the checkmark Maskable is ticked.
Note that the Mask or rect Mask 2D should be the parent of the (raw)images you are trying to mask. The hierarchy should be something like this:
Canvas<br>
| MaskObject (Contains (Raw)Image and Mask or Rect Mask 2d components)
| Object to mask (Contains the (raw)image to mask)
Notice how the white square (Image) gets cut off by the red square (Mask).
The component types between the masking image and the masked image do not need to match either. A RawImage can mask an Image and vice versa.
The Masking objects are again shown in red, where the white are the masked objects. The GameObject's names show the used (raw)image component for that gameobject.
The only exception is the SpriteMask which exclusively works with the Sprite Renderer component
There is not much explanation from Unity on masks... This being the closest to an explanation there is
Some more info about masks:
Masks work by comparing the ref(erence) values of the stencil buffers of the two (or more) objects (in this case images) and only drawing the pixels where the stencil buffer for both equals to 1 using the Stencil's Comp(arison) function. Meaning it is possible to create your own implementation of masks by creating a shader and implementing the Stencil buffer, this comes in handy when for example you want something like an inversed mask, where pixels are drawn everywhere except where the mask is (creating holes in an image) :)
just put the raw image as a child of a UI image and call the parent image "Mask" then put in any shape of sprite in the "Mask" image. Go to 'add component' then 'UI' then add 'mask'. Please look at this link https://learn.unity.com/tutorial/ui-masking#6032b6fdedbc2a06c234cd3e it work well for me

How to convert `mapbox.mapbox-terrain-v2` tiles to heightmap tiles?

Mapbox provides a kindle of map tiles--mapbox.mapbox-terrain-v2 which is stored in pbf format and saved in mvt suffix. The height data is represented by contour (line).
I want to generate terrain with satellite texture and this height data in Unity3D. How could I convert this pbf data to a height map(a pixel for a height value)?
There is an example
https://api.mapbox.com/v4/mapbox.mapbox-terrain-v2/12/1171/1566.jpg?access_token=pk.eyJ1Ijoib2xlb3RpZ2VyIiwiYSI6ImZ2cllZQ3cifQ.2yDE9wUcfO_BLiinccfOKg
And the mvt file
https://api.mapbox.com/v4/mapbox.mapbox-terrain-v2/12/1171/1566.mvt?access_token=pk.eyJ1Ijoib2xlb3RpZ2VyIiwiYSI6ImZ2cllZQ3cifQ.2yDE9wUcfO_BLiinccfOKg
And the document of Mapbox:
https://www.mapbox.com/vector-tiles/mapbox-terrain/
https://www.mapbox.com/vector-tiles/specification/
MapBox have buid a Unity3d package: MapBox-Unity-SDK
SDK here : https://www.mapbox.com/unity/
Just click download.
This is an asset you can open in Unity directly.
Launch Unity3d, goto Menu>Assets>ImportPackage>CustomPackage
and select your downloaded file.
It will unpack some files and the folders, you will find into some exemples scene files to help you.
The current vector terrain layer isn't designed to be turned into a heightmap: we've processed terrain into elevation contours and lines, so turning those back into raw data would be difficult (much like doing the opposite: we do a lot of processing because it would also be difficult to transfer raw data and derive visual data).
A new and improved vector terrain model that supports your usecase is on the way, but we've also introduced RGB terrain, which was actually designed specifically to address cases like Unity - decoding the RGB-encoded elevation tiles tends to be much simpler in software.