3d

Direction vector: Correctly scale sin(radians(x)) + cos(radians(z)) with y axis

Direction vector: Correctly scale sin(radians(x)) + cos(radians(z)) with y axis Question: I have an issue with the directional transform math for a voxel raytracer I’m working on in Python. X axis is left-right, Y axis is up-down, Z axis is forward-backward: I calculate view direction from a camera angle stored in degrees, direction being the …

Total answers: 1

How to plot a multidimensional array in a 3D plot?

How to plot a multidimensional array in a 3D plot? Question: I have a multidimensional array (P x N x M) and I want to plot each N x M array in a 3D plot in such a way the P images are stacked along the z-axis. Do you know hw to do this in …

Total answers: 2

How to efficiently read a GLB file in Python 3.11.1 and extract formatted triangle data?

How to efficiently read a GLB file in Python 3.11.1 and extract formatted triangle data? Question: What I need How to efficiently extract formatted triangle data from the GLB file in this data type: triangles = [triangle1,triangle2,…] triangle = [x1,y1,z1,x2,y2,z2,x3,y3,z3] (1,2,3 – points, values – their coords, x,y,z – dimensions) Here is example of the …

Total answers: 1

Length curve different after 3D rotation

Length curve different after 3D rotation Question: I’m fitting a 2D hyperbolic curve, and print its length as : from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np import math x_max = [ 0 ,0.30473705, 0.61084798, 0.92107771 ,1.23816188, 1.56481854 ,1.90373634, 2.25755771 ,2.62885515, 3.02009822 ,3.43360879 ,3.87150099, 4.33560211, 4.82734953 ,5.34765826 , 5.8967524, 6.4739534 ,7.07741748, …

Total answers: 1

Plotting a 3-dimensional superball shape in matplotlib

Plotting a 3-dimensional superball shape in matplotlib Question: I’m trying to plot a 3D superball in python matplotlib, where a superball is defined as a general mathematical shape that can be used to describe rounded cubes using a shape parameter p, where for p = 1 the shape is equal to that of a sphere. …

Total answers: 1

Plotting surface and curve in 3D and a curve in xy-plane, all in the same plot

Plotting surface and curve in 3D and a curve in xy-plane, all in the same plot Question: To illustrate an optimization problem, I want all of this in the same 3D plot: A surface. A curve in the xy-plane. A curve/path on the surface which marks out the points on the surface that lies directly …

Total answers: 1

make 3d numpy array using for loop in python

make 3d numpy array using for loop in python Question: I have training data with 2 dimension. (200 results of 4 features) I proved 100 different applications with 10 repetition resulting 1000 csv files. I want to stack each csv results for machine learning. But I don’t know how. each of my csv files look …

Total answers: 3

Way to specify viewpoint distance in Matplotlib 3.6.3 3D Plots?

Way to specify viewpoint distance in Matplotlib 3.6.3 3D Plots? Question: I am working on an animation of a 3D plot using mpl_toolkits.mplot3d (Matplotlib 3.6.3) and need to set the view distance. It seems that earlier versions of Matplotlib allowed the elevation, azimuth, and distance of the viewpoint "camera" to be set for 3D plots …

Total answers: 1

Converting a massive into a 3 dimensional bitmap

Converting a massive into a 3 dimensional bitmap Question: Problem I need this massive to serve as an input (for C based arduino). This is our massive from the example above in the required format: const byte bitmap[8][8] = { {0xFF, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0xFF}, {0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, …

Total answers: 3