Shift key + mouse left button is not lowering the terrain. how to lower the terrain? - unity3d

I want to make the ground in this place of the terrain a bit deeper a bit lower but left shift key or right shift key and the left mouse button does not change anything on the terrain.

I've been looking for an answer for hours, and I finally found it.
If you are trying to lower a piece of land that is already at 0 height, you will not be able.
You can only lower areas that are above to height 0. In short, height 0 is the minimum: you cannot go to snow values ​​due to the way the terrain is created.
To be able to make valleys then you have to select the tool "Set Height", enter a height and raise all the ground to that height with "Flatten All", or small pieces of land by dragging the mouse on the ground.
If you click "Flatten All", all the terrain will be brought to that height, losing all the changes made previously for the mountains.
However, if you have already made land and you don't want to lose it and redo it from scratch, you can use the following solution:
Export the current heightmap;
Open the image in an editor; (I'm not an expert in Photoshop or other
graphics programs, but I'm sure Photoshop has a way. If there isn't
an entry in the program, find out how to use scripts in photoshop)
Find a way to set the pixels according to a formula: maximum depth of
valleys + current value of the grayscale pixel * original height /
(original height + maximum depth of valleys);
Export the image in Raw format;
Go back to Unity and import it on the ground as you read in the link
above;
In the terrain settings set the height equal to the value you used
in the formula called "original height" + the “maximum depth of
valleys” value;
You should now have the ground as before, but higher. Set the value
in the transform of the Y position equal to "-maximum depth of
valleys" so that it is at the same height as before.
You should now be able to create valleys!
I haven't tried the process, but I've thought about it so much I'm pretty sure it will work.
Good work!

Related

how to create a time chart in echarts

I'd like to create a time chart
more or less like the chrome devTool's network panel \
consider each row is a machine in a cluster
then from left to right the time passes
each rectangular box is a time span
Question 1: what is the best way to do this in echarts?
Question 2: how can I get the effective width? i.e. the hard coded 551
I'm currently doing it using type:scatter, using symbolSize to draw the rectangles
const effectiveWidth=551
symbolSize: function (val) { return [val[2]*effectiveWidth/(data.max-data.min),10]; }
-- EDIT --
waterfall chart(helpfully pointed out by the comment https://echarts.apache.org/handbook/en/how-to/chart-types/bar/waterfall/) seems working, I initially didn't choose it because I have to create a shadow series(transparent, stacked) for each and every series. is there a way to directly control where each rectangle is placed(like scatter chart)?
for Question2, sorry I should have mentioned dataZoom, when zooming, the effective width changes, but it is not reflected using convertToPixel("grid",...), maybe I shouldn't be using "grid"?
I was using the following code(ec is an echart instance):
const computeScale=(w)=>(ec.convertToPixel("grid",[w,0])[0]-ec.convertToPixel("grid",[0,0])[0])/w
symbolSize: (val)=>[Math.max(0,(scale??=computeScale(86400000))*zoomScale*val[2]-1),10],
but it has some flaws:
the symbol size is in pixel, the val(intended width) is in value(xAxis), thus the conversion is needed. can we tell echart to somehow use the same coordinate system directly without the conversion?
when zooming, the above conversion(using convertToPixel) doesn't work, thus I have to introduce another zoomScale value let zoomScale=1;ec.on("datazoom",(ev:any)=>void(zoomScale=100/(ev.end-ev.start)))(BTW ev.start and ev.end is double value, not integer, so it shouldn't have too much precision problem, but it do have
all these conversion have precision problems, especially zoomScale, it often creates rect overlapping artifacts
https://stackblitz.com/edit/qwik-starter-dhqv1i?file=src/routes/index.tsx
zoom using the handles at the bottom of the preview page to see the artifacts

Meshlab increase point size

How can I increase the point size in Meshlab for point clouds? I found how I can show / hide specific PCs, but I do not see where to change their display properties : size, color, symbol ...
If you are using Meshlab 1.3, you have to do 3 steps:
View->Show Layers Dialog to enable the panel at the right.
Render->Show Vertex Dots, to show the vertices as small circles.
There is a Dot size field in the Layer Dialog that let you change the size of the circles.
If you are using Meshlab-2016 or later, it is even easier...
Click on the tab of vertex and choose the option Dot Decorator (1)
Change the size of dots with the Point Size Bar (2)
In MeshLab, you can just use Alt + mouse wheel to control point size.
Or you can find the point size setting in:
Tools->Options->MeshLab::Appearance::pointSize.

how to change the position of the output result in GUI

Does any one here have an idea about how to change the position of output in the GUI matlab to be to the right side of the box and not in the center ?
i think I have to change some properties of the result text box
Check this post out: Positioning of figures
The figure Position property controls the size and location of the figure window on the screen. Monitor screen size is a property of the root Handle Graphics object. At startup, the MATLAB software determines the size of your computer screen and defines a default value for Position. This default creates figures about one-quarter of the screen's minimum extent and places them centered left to right, in the top half of the screen.
The Position Vector
MATLAB defines the figure Position property as a vector. So you may use a figure and text into it, e.g.
figure(gcf)
text(offsetX1, offsetX1, ['result 1: ' num2str(result1)])
text(offsetX2, offsetX2, ['result 2: ' num2str(result2)])
Displaying analytical results in a MATLAB GUI
This post talks about adding a static textbox with your results and positioning it.
Move GUI figure to specified location on screen:
Syntax:
movegui(h,'position')
movegui(position)
movegui(h)
movegui
The answer is pretty much trying to cover up the vauge nature of the question

OpenXml and Word: How to Calculate WrapPolygon Coordinates?

I am creating a Microsoft Word document using the OpenXml library. Most of what I need is already working correctly. However, I can't for the life of me find the following bit of information.
I'm displaying an image in an anchor, which causes text to wrap around the image. I used WrapSquare but this seems to affect the last line of the previous paragraph as shown in the image below. The image is anchored to the second paragraph but causes the last line of the first paragraph to also indent around the image.
Word Screenshot http://www.softcircuits.com/Client/Word.jpg
Experimenting within Word, I can make the text wrap how I want by changing the wrapping to WrapTight. However, this requires a WrapPolygon with several coordinates. And I can't find any way to determine the polygon coordinates so that they match the size of the image, which is in pixels.
The documentation doesn't even seem to indicate what units are used for these coordinates, let alone how to calculate them from pixels. I can only assume the calculation would involve a DPI value, but I have no idea how to determine what DPI will be used when the user eventually loads the document into Word.
I would also be satisfied if someone can explain why the issues described above is happening in the first place. I can shift the image down and the previous paragraph is no longer affected. But why is this necessary? (The Distance from text setting for both Left and Top is 0".)
The WrapPolygon element has two possible child elements of LineTo and StartPoint that each take a x and y coordinate. According to 2.1.1331 Part 1 Section 20.4.2.9, lineTo (Wrapping Polygon Line End Position) and 2.1.1334 Part 1 Section 20.4.2.14, start (Wrapping Polygon Start) found in the [MS-OI29500: Microsoft Office Implementation Information for ISO/IEC-29500 Standard Compliance]:
The standard states that the x and y attributes are represented in
EMUs. Office interprets the x and y attributes in a fixed coordinate
space of 21600x21600.
As far as converting pixels to EMUs (English Metric Units), take a look at this blog post for an example.
I finally resolved this. Despite what the standard says, the WrapPolygon coordinates are not EMUs (English Metric Units). The coordinates are relative to the fixed coordinate space (21600 x 21600, as mentioned in the quote provided by amurra).
More specifically, this means 0,0 is at the top, left corner of the image, and 21600,21600 is at the bottom, right corner of the image. This is the case no matter what the size of the image is. Coordinates greater than 21600 extend outside the image.
According to this article, "The 21600 value is a legacy artifact from the drawing layer of early versions of the Microsoft Office."

StretchableImageWithLeftCapWidth stretching wrong portions

I am trying to use a UIImage with stretchableImageWithLeftCapWidth to set the image in my UIImageView but am encountering a strange scaling bug. Basically picture my image as an oval that is 31 pixels wide. The left and right 15 pixels are the caps and the middle single pixel is the scaled portion.
This works fine if I set the left cap to 15. However, if I set it to, say, 4. I would expect to get a 'center' portion that is a bit curved as it spans the center while the ends are a little pinched.
What I get is the left cap seemingly correct, followed by a long middle portion that is as if I scaled the single pixel at pixel 5, then a portion at the right of the image where it expands and closes over a width about twice the width of the original image. The resulting image is like a thermometer bulb.
Has anyone seen odd behavior like this and might know what's going on?
Your observation is correct, Joey. StretchableImageWithLeftCapWidth does NOT expand the whole center of the image as you would expect. It only expands the pixel column just right of the left cap and the pixel row just below the top cap!
Use UIView's contentStretch property instead, and your problem will be solved. Another advantage to this is that contentStretch can also shrink a graphic properly, whereas stretchableImageWithLeftCapWidth only works when making the graphic larger.
Not sure if I got you right, but LeftCapWidth etc is made for rounded corners, with everything in the rectangle within the rounding radius is stretched to fit the space between the 'caps' on the destination button or such.
So if your oval is taller or wider than 4 x 2 = 8, whatever is in the middle rectangle will be stretched. And yours is, so it would at least look at bit ugly! But if it's not even symmetrical, something has affected the stretch. Maybe something to do with origin or frame, or when it's set, or maybe it's set twice, or you have two different stretched images on top of each other giving the thermometer look.
I once created two identical buttons in the same place, using the same retained object - of course throwing away the previous button. Then I wondered why the heck the button didn't disappear when I set alpha to 0... But it did, it's just that there was a 'dead' identical button beneath it :)