mathutils now uses the PEP 465 binary operator for multiplying matrices
>>> M = Matrix()
>>> v = Vector()
>>> M @ v
Vector((0.0, 0.0, 0.0))
>>> v @ v
>>> M @ M
Matrix(((1.0, 0.0, 0.0, 0.0),
(0.0, 1.0, 0.0, 0.0),
(0.0, 0.0, 1.0, 0.0),
(0.0, 0.0, 0.0, 1.0)))
As has already been mentioned, the same techniques as used in Zoom Windows Magnification can be used here - but this is very dependent on getting the vector maths correct, which is also critically dependent on getting the geometry and orientation correct, so I'll try and explain the set up in an as easy to replicate method as possible.
For the geometry, we ...
I think one issue with your original solution was due to lack of 'absolute' on your tests on the Normal - it's allowing for > 0.5 but not for `< -0.5'. Also, 'mixing' the individual channels before combining could be causing a problem. Try a material similar to the following :
This can produce the following effect :
EDIT - Here's another alternative ...
The problem here isn’t the Bump node but how the Noise Texture is being used.
With no input to the Noise Texture it will automatically assume Generated coordinates and with nothing connected to the Bump Normal it will automatically assume the Geometry Normal - ie, it's effectively automatically :
NOTE : The nodes shown in white are optional - if nothing is ...
The View Vector is in Camera space, but the Normal is in World space.
You need to transform one of the vectors to the other space if you need to compare them. I learned this now so I mark this question as helpful.
But this can apparently be simplified using the Incoming socket on the Geometry node. Incoming points towards the camera instead of from Camera ...
Since curves can't be rigged, the only way I see it is using Hooks.
Enter Edit Mode and hook each separate curve vertex you wish to move independently to a new object using the option Hook to new Object.
Then go into the second curve and repeat the process. For vertex you want to move together first select a existing empty you wish to hook it to, then ...
It is probably just easier to recreate it using math nodes rather than trying to align it to axis.
Use a Math Node set to Cosine; as input use your desired texture coordinates like Object or Generated.
Add a Separate XYZ node and use the desired axis as direction, then multiply it by any value to control density of the waves.
You can still run the output ...
That's interesting. Iv'e used stable 2.79 and looks like back then it automatically added Displacement node between shader input and map output, and 2.79+ doesn't do that. After adding it manually everything started to work how it supposed to. Even with old preferences. Yay!
Unit direction vector.
Suggest doing this without the transform matrix. The direction vector
>>> d = Vector((1, -1, 0))
can be normalized, ie have a length of one, to
>>> d.normalize() # in place normalize
Vector((0.7071067690849304, -0.7071067690849304, 0.0))
Now, given a source location point p can move from p x units in the ...
I think there is an issue with your premise. The Average Value node works in the compositor by performing operations on a bounded, finite image, with the resolution you set in the Render settings.
In material nodes, however, the vectors you use, and by extension, the colors, are in an infinite vector space. Not only that, but they aren't (by default) ...
You can use a modification of a Vector Product. Here is the node setup:
Let me explain how this works. First, Geometry > Normal gets the normal vector of each point on the object. The Separate XYZ and Combine XYZ nodes respectively isolate the z-component of each vector and return that value as a vector. Because vectors that lie more in the xy-plane than ...
The idea is to work at a given scale, so that the pattern will repeat and using a random (noise) at this scale (each cell will correspond to a random color).
Now imagine the result as a grid, the idea is:
For each cell we want to draw
We take all the 8 cells around it
And have a look if we need to draw something from these 8 cells inside the cell we want ...
You could do it several ways I guess. Here is one (but sorry I won't go too much in details). There are 2 aspects, the rigging and the face animations:
Create your mesh, give it enough geometry so that you will be able to bend it, if you're using a Subdivision Surface modifier of course it would need additional edge loops.
You could directly parent your ...
The node setting is the following:
It uses two textures coordinates with 'object' output.
One is for the purple arrow.
One is for an empty which copies the camera location (just a parenting at its origin).
From that we make the difference for their X and Y coordinates and check if they are both under a given value.
The trick is the ...
The Average operator was initially added to Blender as a way to get a Unit Angle Bisector, which is a unit vector that bisects the angle between the two input vectors. The operator assumes that both input vectors are unit vectors, otherwise, it will not work as expected.
Due to the misleading name and the ambiguity of operation. The Average operator has ...
inst_verts_coords is a list of coordinates (Vectors). So you won't be able to apply a matrix to this list. Maybe you want to change the following line (assuming you want to apply matrix to each individual Vector element of the list):
part_obj_coords = [p.location @ inst_verts_coords]
part_obj_coords = [M @ co for co in inst_verts_coords]
When I do 2D stuff, I use armatures, which work well when the mesh has evenly distribuited quads. In my example I created the line with 4 vertices, then I added some loop cuts until they were evenly distribuited, then I added 2 loop cuts near every joint, then I made the bones to be bendy bones with 2 segments each, playing with curve Y in and out settings.
Looking at the image you attached I'd say it's, but to an extent. I mean you can model in B3D the solid shown and make it transparent. Use Shear for the cross-section, render it. Still, for all those lines an external image editor is the fastest way.
The code can be the following.
We principally need the view vector (axis from the camera) and the view point (cam/eye position) which are given by view3d_utils.region_2d_to_vector_3d and view3d_utils.region_2d_to_origin_3d.
Then we cast on the plane coordinates in two parts as the plane is two tris.
# Get mouse position
mouse_pos = event....
Make a propertygroup property to drive from
Making a property to calculate the rotation between a custom local vector on object A, and one on object B.
Using a property getter on a propertygroup property, to feed a driver variable.
For want of a better name set up an Xxxx propertygroup that will be an object property. The group will contain an object ...
A method using drivers .. a bit tedious, maybe it can be improved?
Create a driver function that can extract the orientation of an object into Custom Properties, and add it to the driver namespace, by running this script:
return (self.matrix_world [axis])
bpy.app.driver_namespace["z_dir"] = z_dir
The manual way of doing this would probably be to extrude it up and then use the"Shrink/Fatten" (Alt+S) tool which scales each Vertex/Edge/Face along its normal which should give you something you might be able to work with.
I wouldn't be surprised if there was already a tool or an add-on to do this more or less automatically but sadly I don't know it
Project plane normal in z direction onto plane.
Here is a test script. Adds a randomly (random 0 to 1 radian rotation on x, y, z) rotated unit circle ngon at cursor, and places an empty on global edge low point.
The normal of the plane is its local z axis.
Global -z axis is considered down.
Find The vector intersection of the line from tip of normal in -z
You can use mathutils.geometry.intersect_line_plane to project the point onto the plane. This can be done by intersecting the line defined by the point and the point offset by the plane's normal vector with the plane:
proj = intersect_line_plane(point, point + plane_normal, plane_position, plane_normal)
Once you have the projected point you can use the ...
Because it involves a dependency loop.
Your normals (including both from geometry nodes and texture coordinate nodes) depend on your bump-- all a bump does, without displacement, is distort normals. It needs to know what your bump is to determine the normals, and it needs to know what your normals are to determine your bump.
Notice, in the picture below, ...
Alright I found the issue, after reading the following observation about Cooktorr in blender dev:
I learned that Blender Internal Cooktorr was actually Blinn-Phong, so I reviewed the math of it and figured out which vector I had misplaced, I leave a picture with the solution, also the link to the math, for reference.
I found a way to create a matrix like this using the script-subprogram method in animation nodes:
And the following script:
from mathutils import Matrix
Rotation = Matrix.Rotation(angle, 4, axis)