(Godot) Sprite bounces off Tiles after Walking (Bug?) - sprite

My Sprite always jumps a little when walking a straight distance. No hitbox is overlapping and I use move and slide with snap

Related

Make controls of multiple objects visible

I try to implement a rotation around a movable rotation point:
I got so far:
here's some snipped
https://jsfiddle.net/Lwg6fkhs/60/
In the example you can select the blue rotation point and the red rect will rotate around that point. You can also move the rotation point somewhere else and the rect will continue rotating around that point.
At the moment the resize controls are only visible if the red rectangle is focused or the rotate control is visible when the rotation point is focused. I would like to make all controls (grab handles) of the red rectangle and the rotation rectangle visible at the same time. Is that possible? Or is there another way to implement that behavior with less or similar amount of code by modifying the behavior of the red rectangles rotation control?

What is the Godot way to define (and refer) custom rectangle areas?

I'm coming from Phaser + Tiled world, where, if I need some rectangle area in game world (like Player's area, spawning area, and so on) I can just draw rectangle in Tiled and then get it coordinates from Phaser.js and use as I need. And I seem to stuck to do similar things in Godot.
For some of tasks I can use Area2D with rectangle inside and collision events. But it is not always enough.
How can I just define rectangle on screen, and get its coordinates? For Sprite object and for Node2D I cannot get bounding rectangle. I can use Area2D + Rectangle and refer to rectangle's 'extent' property to get width/height, but that seems to be overhead for me - Area2D is used in collision detection.
What can I do in general? And what could be done in Godot for following scenarios?
Camera limits. I have Sprite with background gradient which I scale to needed world size, and I'd like to set camera limits on that Sprite's width/height.
Hero movement limits. Half of world is not accessible for player, so any move to x > MIDDLE shall be denied. I can just setup constant MIDDLE in the code, but I'd like to draw allowed area as rectangle and refer to it coordinates.
Spawn area. Mark some place of world (that could be just point, not rectangle) where new objects shall be created by code.
You could use the Rect2 class in a script to define custom rectangles. You can then use it to check whether it contains a Vector2 or another Rect2.

Autodesk Maya per pixel surface position and normals through whole scene

how can I get in maya per pixel all surface positions and normals of the entire scene.
I don't want to stop at the first viewed surface of the camera. I need to get information about all object. I want to traverse the whole scene
For example a cube is in front of the sphere. The camera position just shows the cube - the sphere gets at that camera position by the cube. My output of every pixel position of my camera rendered image data gives me information of the surface position in world space and the normal of the cube at the first hit. Then again for the other side of the cube. Then the two surfaces of the sphere.
How can that be achieved?
Thanks

Terrain tile scale in case of tilted camera

I am working on 3d terrain visualization tool right now. Surface is logically covered with square tiles. This tiling could be visualized as follows:
Suppose I want to draw a picture on these tiles. The level of detail for a picture is required to be selected according to the current camera scale which is calculated for each tile individually.
In case of vertical camera (no tilt, i.e. camera looks perpendicularly on the ground) all tiles have the same scale which is camera focal length divided on camera height above the ground.
Following picture depicts the situation:
where red triangle is camera which has no tilt, BG is camera height above the ground and EG is focal length, then scale = AC/DF = BG/EG
But if camera has tilt (i.e. pitch angle isn't 0) then scale is changed from tile to tile (even from point to point).
So I wonder if there any kind method to produce reasonable scale for each tile in that case ?
There may be (there almost surely is) a more straightforward solution, but what you could do is regular world to screen coordinate conversion.
You just take the coordinates of bounding points of the tile and calculate to which pixels on the screen these will project (you of course get floating point precision). From this, I believe you can calculate the "scale" you are mentioning.
This is applicable to any point or set of points in the world space.
Here is tutorial on how to do this "by hand".
If you are rendering the tiles with OpenGL or DirectX, you can do this much easier.

Moving a turtle to the center of a circle

I've just started using the turtle graphics program, but I can't figure out how to move the turtle automatically to the center of a circle (no matter where the circle is located) without it drawing any lines. I thought I could use the goto.() function but it's too specific and I need something general.
Use penup to lift the pen and draw nothing while moving.
If your rotate 90 degrees left and then move forward one radius length you will be at the centre of the circle (and lifting the pen first to stop it drawing a line as outis said).
for example
import turtle
myT=turtle.Turtle()
# draw your circle
myT.circle(100)
# rotate so you are looking towards the centre of the circle
myT.left(90)
# lift the pen so no line is drawn
myT.penup()
myT.forward(100)
# put pen down now (if you need to)
myT.pendown()
# rotate back (if you need to)
mtT.right(90)
This is because you are always facing along a tangent to the circle you just drew and the angle of a tangent to a radius is always 90 degrees (right). This is assuming you just drew the circle, a whole lot of trigonometry involved if you want to calculate the location of the centre of some older arbitrary circle!

Resources