Questions tagged [mathematics]

Use of maths inside blender.

Filter by
Sorted by
Tagged with
30
votes
1answer
2k views

Physical iridescence in Cycles?

Having recently seen the Siggraph paper A Practical Extension to Microfacet Theory for the Modeling of Varying Iridescence, I of course said to myself "I have to have this in Blenderrrrr!" and started ...
4
votes
1answer
916 views

Vertex colors are wrong value?

I am using a renderlayer with some vertex colors to render some masks. I have an object with a vertex color layer. The entire object is set to RGB values of .25 each (using set vertex colors command.) ...
1
vote
1answer
2k views

Calculate angle between two vertices of two different objects

I have a scene in which there are two objects, a sphere and a pole: I would like to calculate the angle between two vertices: one belonging to the first object and the second belonging to the second ...
4
votes
1answer
2k views

Filling pentagon with quads (combinatorics)

How to subdivide edges of the pentagon so that when I'm making grid with faces I get perfect quads or almost all quads ? This is more math-combinatorics question but is quite important for the mesh ...
1
vote
1answer
106 views

Fix/Freeze/Clamp Object Info at certain value [duplicate]

I am using an object's 3D position to apply a diffuse colour. I have a selection of objects that are different Z positions and hence have the colour ramp applied to them. As objects merge back into ...
2
votes
2answers
1k views

How to get angle of edge ? (python)

How can I get the angle of the edge , is there a method that return the angle of selected edge ?
3
votes
2answers
2k views

How to create a 3D object from a specific equation

I realize this has been asked before, so I apologize for the "repeat". I saw this answer, and it mostly solved my issue. However, I can't figure out how to generate my specific equation. This is my ...
10
votes
1answer
2k views

HSV to RGB conversion

let's take the hsv color 0.4, 0.8, 1.0 everywhere I looked this converted to Hex 33FF85 - even in Blender when I convert it to RGB(using python colorsys, python ...
1
vote
0answers
65 views

particle simulation distribution on a surface using the analytical expression

Not sure if this is possible with Blender or not. I have a collection of particles all with the same mass and same charge. I want to distribute them on a surface which I have the analytical expression ...
5
votes
2answers
1k views

creating mesh on an isosurface

I have a function like $f(x,y,z)=\text{constant}$. It is not straightforward to solve $z$ as a function of $x$, $y$, and $\text{constant}$ analytically. So, I want to choose a Constant value, draw ...
1
vote
0answers
565 views

normal vector calculation on a surface

Given a function like f(x,y,z)=constant like an isosurface, I was wondering if there is any way to: 1) create a mesh and save the coordinates of the points into a separate file? 2) calculate the ...
0
votes
1answer
275 views

Creating mesh on a surface with two variables

I have an equation like this: $\cos(z)+\sin(x)+\sin(y)=1$ and I want to do something like: Graph in blender a function of two variables, I followed the proposed method in the same post. It was ...
2
votes
0answers
352 views

How to make a dodecahedron? [duplicate]

I would really like some help to make a dodecahedron! That means i would like to make a "ball" form made entirely of pentagons.
0
votes
1answer
129 views

Find lower left vertex of a quad with python

I'm a looking for a simple and fast way to find the lower left vertex index of a quad with python. What I've tried so far is to change the coordonate system to fit with the normal and sort the ...
2
votes
0answers
464 views

Change rotation order of a matrix

So, I am writing an exporter to another scenegraph format. Trouble is I suspect it has a different order of rotation (not 'XYZ'). So how do I change a Blender Matrix 3x3 or 4x4 into one that has same ...
6
votes
1answer
3k views

Graph in blender a function of two variables, [duplicate]

I would like to know if there is any way to be able to graph in blender a function of two variables, for example Sin (x y2) for the domain of x from -3 to 3, the domain of y from -2 to 2, to get ...
3
votes
2answers
1k views

Animating z surface math functions

I would like to use the z-math-surface add-on to animate a function with a free parameter like sin(x+a) where the effect of different values of "a" should become clear to the viewer. I am quite new ...
6
votes
1answer
876 views

How to make a node group to calculate fresnel via F0 values

Object I want to make a node group so I can enter a F0 value instead of the IOR value for fresnel. Purpose The purpose is to make a fresnel node group for metallic shaders, since default fresnel isn't ...
0
votes
1answer
164 views

Adding a keyframed Brownian Motion to an object

How can I give an object a motion like the particles' Brownian motion, keyframing the object location value for each frame? Is there a better way than just using a random value?
2
votes
2answers
861 views

Nodes: Lighten/Darken “Crossfader”

What I seek I'm not sure if "crossfader" is the best way to describe it, but imagine black on one end, white on the other, and a grayscale image in the center. You can lighten or darken the image ...
5
votes
2answers
3k views

How to turn a mesh inside out, like a sock?

I am working with a 3D scan of an object that has convex ridges. Here is a screenshot of the object: I am trying to use the interior of the model to create a space for a video game. As you can see in ...
10
votes
4answers
4k views

Use Latex in Blender

I want to use math text in Blender. For example, I would like to have fractions (A/B) where the letter A is on top of letter B and the division line is horizontal. I also would like to move this ...
3
votes
2answers
3k views

How to multiply vector by scalar in material nodes?

I'd like to do arbitrary vector math with the camera position, shading point, and possibly other points. As a test case (blend file), suppose I want to make a shader that will draw a simple gradient ...
0
votes
2answers
103 views

Get Bounding Box Lenght Of Curved Road

Ok so I got this curved block And I want to calculate it's exact length using bounding box. How can I do it?
0
votes
1answer
104 views

Equivalent Mix fac to Fresnel?

Normally we use Fresnel (either from the node or layerweight) to mix between Diffuse and Gloss shaders. This works best for normal shaders, but isn't always best for non-realistic shader setups, or ...
1
vote
1answer
576 views

Recreate to_track_quat with two vectors using python

i've been asked to recreate the to_track_quat function of mathutils to create a quaternion that looks from point a to point b, but so far i've been un successful. I'm using in blender two objects, ...
3
votes
1answer
488 views

mathutils.geometry.intersect_ray_tri()

I have a problem. I use the intersect_ray_tri() function to find the intersection between a ray and a mesh. Somethimes it works perfectly fine and somethimes it only finds one of the two intersecton ...
2
votes
2answers
447 views

How to make variable transparency hole in a plane with a math function using nodes?

One way to make a transparent hole in a plane with graded transparency is to uv-map a solid, monochrome image with graded alpha (I assume). But can I do this with nodes? I've used the Error Function ...
0
votes
2answers
940 views

Rotate bmesh around Vector with Python

I try to rotate a bmesh around a vector as axis. ...
0
votes
2answers
1k views

How to mathematically round positions of all vertices to nearest integer?

I have a mesh with 1.5M vertices, and I'm trying to round off vertex positions to reduce the filesize of my exported .obj file. Each vertex has a very high level of precision, which I don't really ...
3
votes
1answer
659 views

How to point a sun lamp using a vector in Python?

It seems this should be easy - I have a long list of normals as a list of tuples in my python script. [(nx, ny, nz), (nx, ny, nz), (nx, ny, nz)...] Each tuple ...
27
votes
3answers
12k views

How can I generate an object from a mathematical function?

I have a formula that mathematically describes the heart surface in Cartesian coordinates: $$\left(x^2+\frac{9y^2}{4}+z^2-1\right)^3-x^2z^3-\frac{9y^2z^3}{80}=0$$ Unfortunately, I have no idea how ...
0
votes
1answer
359 views

Compositor: Get the average value of an input fac

I want to take an input factor, such as a mask or pass, and get the average value of the pixels within it. How can this be done?
2
votes
0answers
68 views

Source to read about the math in World Matrix and Blender's use of quaternions?

I'm going to show some slides about using Blender to illustrate three dimensional and time-evolved physics simulations by just (pasting and) running the python within the blender user interface. ...
1
vote
1answer
319 views

Does the Vector Math Normalize operation use the second input?

The Vector Math node has an operation called Normalize. I have always presumed that this is a monadic operator which ignores the second input and returns a unit vector in the direction of the input ...
4
votes
1answer
369 views

What does the “unused” output on the Vector Math node do?

The Vector Math node has two output sockets, Vector (vector type) and Value (scalar type). Most of the vector operations (Normalize, Cross Product, Average, Subtract, and Add) result in vectors, what ...
26
votes
1answer
1k views

Closing “Fibonacci's Hole”

Creating a sphere using the points defined by Spherical Fibonacci Mapping. For the most part it is easy to "skin" by using two consecutive fibonacci numbers as steps to loop on the index. And get ...
2
votes
3answers
532 views

Ellipse Construction Advice

I'm working on a add-on for Blender, and part of this add-on requires me to calculate the position verts along the arc of an ellipse. At the moment, I'm using the { ...
1
vote
1answer
169 views

Normalize mix shader fac to .75 as midpoint instead of .5

(I'm not really sure of the proper way to title this question, so feel free to edit.) I am mixing 4 shaders together: 1 diffuse and 3 toon diffuse, as seen in the image. By default, I want them all ...
1
vote
1answer
121 views

Why ray_cast is behaving like this?

Why the result of ray_cast function is giving me that result? The hit point should be Vector(0.5, -1.0, 0.0), but it is returning ...
0
votes
1answer
161 views

One node group input override another

I have a procedural texture node group that is being commonly used by a lot of materials as part of a global shader setup for a project. For a few objects in the scene, I want to use a image texture ...
0
votes
1answer
190 views

How does blender work? [closed]

I am new to 3D modelling and blender, I come from a programming background, I am fascinated by the kind of things blender can do. The more I use blender the more questions I have and the more confused ...
3
votes
0answers
121 views

Multiple Random numbers per material [duplicate]

I want to randomize several procedural textures in the same material. For example, have 3 different Noise textures with a random number as their Scale. I can use the Random output of the Object Info ...
0
votes
0answers
496 views

get the rotation of a face

I'm trying to get the rotation of bmeshs face. Unfortunately following function doesn't work: ...
0
votes
1answer
163 views

Blender Math Square

I want to make a square with the scale of "8.1". The square should be hollow and inside the square are 81 other smaller squares with the scale of "0.3" Is there a way to automatically do this without ...
3
votes
1answer
2k views

How do you create a Math Formula for a Model Object?

In Carrara 4.0 Pro, I am able to create various modeling objects using math. The UI comes with 4 sliders (p1, p2, p3, p4), with values varying from -1 to +1 or -pi to +pi, and a text area for the ...
3
votes
1answer
770 views

Why does Quaternion.rotation_difference() always return 12.666471 for x-rotation?

I tried to calculate the angle between two vectors. First 3 Quaternion rotations (qx,qy,qz) are defined and multiplied to q. A vector v (1,0,0) is rotated by q. From the vectors q and qrot I want ...
1
vote
1answer
264 views

How to perform trig functions on a vector element-wise?

I'd like to get the cosine of all elements in a Vector in Blender's python. Should I just use numpy for this? Edit: I was tired when I wrote this and kind of mis-posed the question. What I actually ...
9
votes
2answers
1k views

Which of Blender's bpy.props properties can store a Matrix?

In my script I am trying to store a Matrix, for example the region_3d.view_matrix of a 3D view. This returns: ...
3
votes
2answers
718 views

Additive Emission in Cycles [duplicate]

Question is how to create additive shader. If you need particles which just "add" light to a scene. Not render a surface but create emission. If color changes from yellow to red for example, the ...

1
3 4
5
6 7