# Questions tagged [mathematics]

Use of maths inside blender.

221 questions
Filter by
Sorted by
Tagged with
631 views

### Python Math Functions Fail In Blender

My problem is this: I try and run the script in Blender's text editor and the script fails to math functions, cos() does not work. When I run the same code in Blender's Python console my pasting it ...
366 views

### How can I add/subtract/multiply/divide properties in the Game Engine?

I am creating a Random Math Engine using the BGE and I am wondering how I can do mathematical operations between two properties. Example: "Property 1 + Property 2" and then it would output the answer ...
703 views

### How to read a bone's quaternion rotation and convert from local bone to world space

I am writing a custom exporter to export from blender to my opengl program. To read the roatation, as well as convert from blender's cordinate system to my game's system, i use this code: ...
333 views

### creating fractal materials with node editor

does anybody know how to generate a 2D fractal like the classic Mandelbrot set, as a 2D material using the node editor? im looking to make something similar to how the texture nodes like the wave ...
197 views

### Bevel modifier auto segments

Recently I created a video about a way to increment automatically the number of segments. My question is is there a way to script and integrate the formulas directly bpy.context.object.modifiers["...
1k views

### Animate an object along the z-axis in a sin wave

So I wanted to make an animation of an object where it bobs up and down along the z-axis, like a sin wave on a graph. I understand one way of doing this with drivers, by which I add a driver to the ...
2k views

### How to: Exponential Fall Off for Volume Density?

I'm trying to create a photorealistic Earth Atmosphere. Several papers written on the topic of atmospheric scattering state that our atmosphere's density has an exponential fall off, with most of it ...
2k views

### Plotting 3D Surfaces

Building on from my previous question, how can I plot something more complex than a sphere (and not as easy to split into a set of parametric equations)? Say, for example $$2x^2+y^2-5z^2+z-7x=16$$ ...
150 views

### Plotting 3D Regions

How can I plot a simple 3D region such as $$x^2+y^2+z^2<16$$ in Blender? If I can't do that directly, how can I turn it into $$x=\dots$$ $$y=\dots$$ $$z=\dots$$ So I can use Mesh --> Math ...
396 views

### Practical use example of Dot product and cross product? [closed]

Edit : Problem Solved . Thank you I have read all Dot product and cross product related questions and answers. Thanks to explainations of some supportive community members Now I know what dot ...
131 views

### What's the algorithm used in bm.calc_volume()?

I need to know which algorithm is used in bm.calc_volume() (https://docs.blender.org/api/blender_python_api_2_67_release/bmesh.types.html#bmesh.types.BMesh.calc_volume) or which theorem is based on. ...
154 views

### Blender Cycle's z-coordinate vs. camera-centered z-coordinate (orthogonal distance)

Rendering a scene and writing the 'Z-buffer' into an EXR file using 'Blender Cycles', I get a depth map. That depth map differs from the depth map which is produced by 'Blender Render'. Given its ...
1k views

### how to change a mesh given by mathematical function with time i.e. how to include the time parameter in the mathematical equation?

I am trying to make an animation in which a mathematical function changes as a function of time. Given below are two images which are z math surfaces(from the "extra objects" add on) whose equations ...
128 views

### Procrustes in Blender

I am trying to solve the Orthogonal Procrustes problem inside Blender for a specific case but I am having some trouble. I have a face and a pair of glasses in my scene. They are not in a specific ...
2k views

### How to calculate Specular value for Principled BSDF node from IOR?

With regard to the manual the Specular value for the new Principled BSDF node can be computed with following formula: $\text{specular}=\left(\frac{\text{ior}-1}{\text{ior}+1}\right)^2/0.08$ For ...
281 views

### Creating sinusoidal struts using bpy

I want to use Blender and bpy to create sinusoidal struts. I have been using Python with VTK in the past, but it is causing some trouble and I feel Blender might be the better solution. An example of ...
107 views

### Compositor: Get the second darkest value

I have an image that is mostly values between .3 and 1, but has a few areas of solid black. I want to set all the pure black areas (or perhaps near black to also catch aliased edges) to be the next ...
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 ...
555 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.) ...
1k 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 ...
1k 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 ...
85 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 ...
874 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 ?
1k 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 ...
59 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 ...
820 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 ...
468 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 ...
210 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 ...
349 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.
92 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 ...
346 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 ...
2k 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 ...
871 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 ...
666 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 ...
123 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?
654 views

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 ...
2k 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 ...
2k 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 ...
2k 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 ...
94 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?
87 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 ...
336 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, ...
370 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 ...
349 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 ...
628 views

### Rotate bmesh around Vector with Python

I try to rotate a bmesh around a vector as axis. ...
710 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 ...
540 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 ...
9k 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 ...