Questions tagged [mathematics]

Use of maths inside blender.

Filter by
Sorted by
Tagged with
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. ...
1
vote
1answer
272 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
220 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 ...
25
votes
1answer
955 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
399 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
138 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
112 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
117 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
180 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
73 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
367 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
141 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 ...
2
votes
1answer
1k 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 ...
2
votes
1answer
582 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
210 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 ...
6
votes
2answers
843 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
570 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
vote
1answer
455 views

How to project a 3D Bone POSE Matrix to 2D (XZ) Plane?

I have a Posebone Matrix which I want to project to the Front (XZ) View. Currently the bone axis can direct anywhere because they can have a custom bone roll which can direct the axis anywhere. I want ...
2
votes
1answer
518 views

How to get transform values that would be set from inserting visual key-frame for pose bones?

I have some bones with any number of constraints. I want to get the visual transform matrix of that bones that takes also into account when for example a stretch to constraint modifies that bone. So ...
1
vote
0answers
117 views

What algorithm does Blender's motion tracking use? [duplicate]

I would like to know what kind of algorithm Blender uses in motion tracking?
1
vote
1answer
38 views

Looking for a correct formula

I have set up a scene in the bge where I need to animate the mist. I have an object that loops between 0 and 4999 and I assigned its action current frame number to a property called 'axisT' Now I want ...
3
votes
1answer
1k views

BGE - Calculate Acceleration from Velocity

I need to calculate acceleration of my rigid-body object in Blender Game Engine. What I did now is: ...
3
votes
4answers
2k views

Possible to use object speed/acceleration as driver variable?

If I have an animated moving object, is it possible to get its speed and/or acceleration vector into a driver variable? Some ideas I've thought of and haven't worked out: Obviously differentiating ...
9
votes
1answer
1k views

IES-like lights in Cycles

I have been consistently trying and failing to recreate the techniques described in the links to create an IES like textured light effect with Cycles Spotlight lamps using a Color Ramp node. http://...
27
votes
3answers
8k views

What is Dot Product?

I am doing this Blenderguru tutorial on Making Fire and at some point he is adding the Vector Math node Dot Product to his material. And he says that he does not understand what he is doing but this ...
14
votes
1answer
3k views

Using Blender for plotting graphs?

While gnuplot is serviceable and matplotlib is a popular choice for Python developers, I wanted to use Python for plotting some simple graphs (matplotlib had some issues installing on my system, with ...
1
vote
0answers
100 views

How to preserve UV coordinate in python scripts when faces are transformed?

I'm writing python scripts that preserve UV coordinates when faces are translated/rotated/scaled. And I know similar feature exists in Presages Creator. https://youtu.be/QH3G9qZgjfw?t=3m32s ...
2
votes
1answer
243 views

How can I align faces that share an edge in Python? (without moving the common edge)

I need to set a face's direction from a Python script using bpy modules. I tried the below code, but it does not work correctly. ...
12
votes
1answer
3k views

How can I create 3D surface of sine waves?

I would like to make a surface that obeys the equation: z = Asin(x) + Asin(y), 0<=z<=1; 0<=x<=2npi; 0<=y<=2npi Where I would like to be able to change n to increase/decrease the ...
0
votes
2answers
75 views

Detect when object is sliding backwards

I am working on a skateboarding game and I need to detect when an object is moving backwards so the character can change stance and the controls will swap. For example after doing a 180, or when ...
9
votes
1answer
2k views

Sine wave using only Math nodes?

For the purpose of animating materials, is there a way to construct a sine wave function out of Math nodes? A while back I asked about how to do something similar with scripted driver expressions. ...
8
votes
2answers
2k views

How to find all objects in the Camera's view with Python?

I have a scene with a many objects and one camera. I would like to select the objects that the camera sees, even partially. Is there a way to do that in Python that accounts for the objects bounds? ...
15
votes
2answers
8k views

how are the math node operations in cycles calculated?

How does the math node do calculations with a specific operation: the usual operations of add,subtract, multiply and divide are quite understandable and are(empirically) very similar to some of the ...
3
votes
1answer
703 views

Can a shape key be negative?

It seems shape keys can't manually be set to a negative number or a number larger than 1. I've even tried using a driver to drive the value of the shape key beyond either of these extremes with no ...
2
votes
1answer
406 views

Why does “sin(frame)” where frame is “1” set a shape key to 0.841 and not 0.017?

I am trying to animate a shape key oscillating between -1 and 1 by driving it with the expression "sin(frame)". I would expect that to result in the shape key value being "0" at frame 0 and 180, a ...
2
votes
2answers
5k views

What is the C# Mathf.Lerp equivalent in Python?

I have a basic menu script with a slider. The idea is that the slider will control the rotation of a bone. That bone will then rotate the object. I worked out the exact euler angles to rotate it by, ...
4
votes
1answer
438 views

Why can't I type simple formulas when using transforms? [duplicate]

what its happening here? i just want to rotate R 360/5 but if do that the math function turns in to something like R [1/(360)] ...
4
votes
1answer
289 views

Create a compositing node 2D Vector from individual x & y components

A node I want to use requires it's inputs to be Vectors. However, video tracking nodes output separate x & y components, not a Vector. I can't seem to find any node that allows me to create a ...
4
votes
1answer
187 views

What happens when you plug a BSDF into a value socket?

What happens when you plug a BSDF (shader) socket into a value (float/color/vector) socket, or vice-versa? Obviously there is no way to convert a function to a value, so what does blender do? From ...
6
votes
1answer
2k views

What does the “Absolute” setting in the Math node do?

The documentation is a little unclear. "Always return non-negative value from any operation input 2 between input 1." https://...
5
votes
2answers
1k views

How to delete all faces with distance to other object

I want to delete all faces (of "Mesh") with a distance > 0.5 to the nearest point of an other object ("Sphere"). Unfortunately it deletes the whole object. Thanks for helping! ...
2
votes
0answers
705 views

How to intersect two planes?

I am trying to use the geometry.intersect_plane_plane function, but I can't use the results properly. On this tryout, we have two points (...
23
votes
3answers
5k views

What do glossy distribution models do?

In Cycles, the glossy (and anisotropic) shaders have a Distribution option. Since I don't really know the difference, I have always left it at it's default (GGX). So what is a distribution model, ...
8
votes
1answer
2k views

Build color ramp out of math nodes?

I want to use color ramps or RGB curve effects in my node groups. This runs into the problem that the only sockets these nodes have is their input image and factor. This means if I have them in a ...
2
votes
1answer
591 views

Particles and Random Numbers and Cycles Render

Goal. Have access to a random number in range [0-1] per particle per frame in a Cycles Render Node. Particle System is used. Multiple particles per frame. Question. How can Blender drivers/other ...
2
votes
1answer
478 views

How to make a F-curve with a constant and linear part?

As part of a problem I need to obtain a curve in the graph editor, that has a constant part , followed by a linear one. for instance: for the interval [0,100] the curve is y=0 for the ...
1
vote
0answers
66 views

How to display a number as output value in node-editor? [duplicate]

I would like to input a numeric value and output also a numeric value after it has gone through some nodes realizing a mathematical function. I know how to realize the mathematical function with ...
2
votes
0answers
404 views

Scripts: Converting Quaternions to Pre/Post Rotations

An issue that I've noticed while working on models for a specific game engine, is that when using exporting FBX models or BVH data comes the fact that you have two different rotations formats, with ...
2
votes
1answer
2k views

Python: Calculate angle between vertices

What should I do to determine the angle on XYZ between two vertices? I then have to rotate a mesh accordingly, but I guess that's a basic task to achieve. I'm new to bpy and I should have payed more ...
13
votes
4answers
1k views

Cycles node editor - Map gray scale value map to extremes

I have a value map that is black and white, but it covers a very small range of that spectrum, having the brightest value at 90% grey, and the darkest somewhere around 80% grey. What I need to do is ...