Questions tagged [mathematics]

Use of maths inside blender.

Filter by
Sorted by
Tagged with
1
vote
1answer
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 ...
3
votes
1answer
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 ...
6
votes
1answer
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: ...
1
vote
0answers
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 ...
0
votes
1answer
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["...
2
votes
1answer
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 ...
14
votes
1answer
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 ...
9
votes
3answers
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$$ ...
3
votes
1answer
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 ...
2
votes
0answers
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 ...
1
vote
0answers
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. ...
4
votes
1answer
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 ...
5
votes
3answers
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 ...
1
vote
1answer
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 ...
4
votes
1answer
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 ...
3
votes
1answer
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 ...
2
votes
3answers
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 ...
27
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
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.) ...
1
vote
1answer
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 ...
4
votes
1answer
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 ...
1
vote
1answer
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 ...
2
votes
2answers
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 ?
3
votes
2answers
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 ...
1
vote
0answers
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 ...
4
votes
2answers
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 ...
1
vote
0answers
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 ...
0
votes
1answer
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 ...
2
votes
0answers
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.
0
votes
1answer
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 ...
2
votes
0answers
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 ...
3
votes
1answer
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 ...
3
votes
2answers
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 ...
6
votes
1answer
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 ...
0
votes
1answer
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?
1
vote
2answers
654 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 ...
3
votes
2answers
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 ...
8
votes
4answers
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 ...
3
votes
2answers
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 ...
0
votes
2answers
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?
0
votes
1answer
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 ...
1
vote
1answer
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, ...
3
votes
1answer
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 ...
2
votes
2answers
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 ...
0
votes
2answers
628 views

Rotate bmesh around Vector with Python

I try to rotate a bmesh around a vector as axis. ...
0
votes
2answers
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 ...
3
votes
1answer
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 ...
26
votes
3answers
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 ...
0
votes
1answer
256 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
67 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. ...