Suppose I have got the face euler angles (pitch, yaw, roll) now. How can draw the 3D Coordinate Axes which show the face pose. Here is an exmaple from here: ...

I am having trouble rotating an ellipse in OpenGL. So, I have some code to draw an ellipse as follows: glPushAttrib(GL_CURRENT_BIT); glColor3f(1.0f, 0.0f, 0.0f); glLineWidth(2.0); glPushMatrix(); glTranslatef(0, 0, 0); // ellipse centre glBegin(GL_LINE_LOOP); float inc = (float) M_PI / 500.0; for (GLfloat i = 0; i < M_PI * 2;...

So the method that I've used so far to rotate objects in JavaFX was that I layered it in 3 groups, each of them with a Rotate attached and locked to a single axis like so: Rotate heading, roll, pitch; Group normalrotate, rollrotate, verticalrotate; heading.setAxis(new Point3D(0,1,0)); normalrotate.getTransforms().add(heading); roll.setAxis(new Point3D(0,0,1)); rollrotate.getTransforms().add(roll);...

I need to plot some points in 3d surface based on x,y,z coordiantes values in a file named as test.dat test.dat file contains At-No X Y Z 6 3.532210 -2.171743 0.921140 7 1.164869 -1.418981 0.782133 1 2.454732 2.332989 -0.907213 6 -3.246376 -1.047325 -0.602590 6 -2.620684 0.053348 -0.013310 6 -4.569969 -1.249720...

I want to convert 3dsmax file to patent diagrams in different perspectives. I am new to 3dsmax, and i want to know if there is any method to export it to line drawings like the ones that is available in patents

So what I'm trying to do is make a transformation matrix for 2D GUI objects. When I multiply my three transformation matrices together, Rotation and Scale actually effect the rotation and scale of the object, but not Position. I checked in GDebugger, and the matrix is being properly calculated, but...

i want to use Leap Motion to get my Index finger Tip position in the space ( 3D position X,Y,Z ) , how can i do that in leap motion ? this is what i do only to detect index finger, but there an error : def on_frame(self, controller): #...

I try to find 3D coordinate (in world )of abject that I know his coordinate in image .so after some research in internet I succed to find X and Y cordinate. but I can't find Z that is my program in openCV void drawAndCalcul3D(int x,int y,Mat& frame) { cv::Mat uvPoint...

I am writing a program in WPF. I am using HelixToolkit to load models from file (I need to load several models from files) like this: var importer = new HelixToolkit.Wpf.ModelImporter(); Model3D triangle = importer.Load("hand.obj"); ModelVisual3D Model = new ModelVisual3D(); Model.Content = triangle; MainViewPort.Children.Add(Model); And I need the entire Model3D,...

I am trying to implement smooth 3D camera in my game. So, I have a few reserved positions and directions and I want to change view of my camera by applying them to my camera. Now I am doing it like below: //Reserved positions and directions //View #1 Vector3 pos1...

I am building 3d line chart from data here is the code Demo the part of code that generate line is parentTransform = new THREE.Object3D(); var _color = d3.scale.category10(); for (var i = 5; i > 0; i--) { var material = new THREE.LineBasicMaterial({ // color: 0x0000ff,linewidth: 30 color: _color(i),...

Implementing the answer from this thread I have this code that translates the deltayaw, deltaroll and deltapitch angles into one angle and rotates a node around it. The angles that are taken as the parameters are momentary changes of angles since giving the whole angles would ignore the changes in...

I would like to generate some shapes in JavaFX and export it to STL format for 3D printing. Is there a library out there to help with the export?

so far I got a cube rendered without any transforms (thus it was rendered in an orthographic perspective), and I am working on the previous code to get it into a perspective view, with all the matrices involved. I changed the Flexible Vertex Format so as not to have RHW...

I was trying to convert 2D images to 3D by rotating them about the axes (like a circle to a sphere). Currently my problem is that suppose I have two functions f(x) and g(x) both in one variable. I wish to make a plot of the functions and use rotation...

Google's made a big deal of "if you hide it, it won't count." However, google cache shows it doesn't understand a lot of things correctly. Maybe google sees something as hidden when it should show or shows when it should be hidden. So, I ask about CSS 3D transforms. Take...

Anyone knows what kind of mesh representation data structures (half-edge, quad-edge, winged-edge etc) popular software like Lightwave 3D, Maya, Softimage, 3D studio and others use?

I am trying to create a cylindrical 3D surface plot using Python, where my independent variables are z and theta, and the dependent variable is radius (i.e., radius is a function of vertical position and azimuth angle). So far, I have only been able to find ways to create a...

I have created a multiplayer pool game in HTML5 canvas and it is working just fine. I would like to enhance it with real ball rotations. Now I'm using simple png files for balls which cannot "rotate" in any direction (they can but it is not real). Is there any...

I'm getting an error when using Image3D function of mathematica. I am trying to use that function to create a 3D volume from the array imagevar, which contains 10 grayscale binary images. images = FileNames["*.png"]; count = 1; Do[imagevar[count++] = Import[image], {image, images}] Image3D[imagevar[]] Whenever I run it, it returns...

I want to do Java 3D Graphics without using external libraries to develop a game applet. Sorry I am not that experienced with Graphics and so I am not sure how hard it would be to do it by myself

What is the best way to drag 3D point with mouse picking. Issue is not the picking but to dragging in 3D space. There are two ways I am thinking, one is to get the View to World coordinates using gluUnProject and translate the 3D point. The problem in this...

I am making a 3D model of the volume generated by two functions: one as the base (in intersection of the x-axis), and the other as the height of the volume.This is achieved by approximating the volume of small parts, drawing that mesh, then adding all of the meshes together....

I have 20 data points in 3D space. Here you can see them plotted: clear all close all clc Data = [97.4993 104.3297 0.7500 196.7021 100.0000 105.0000 0.7500 290.9164 100.0000 107.5000 0.7500 142.1626 96.2569 106.4992 0.7500 143.3605 97.5028 104.3317 1.0000 197.1111 100.0000 105.0000 1.0000 290.4210 100.0000 107.5000 1.0000 144.0155 96.2530...

The symptom is, that the "position of the camera" seems to be mirrored around the x axis (negative z instead of positive z) and the "orientation of the camera" is opposing to the expected. In other words, I have to rotate the camera by 180 degrees and move it forwards...

I am drawing spheres on billboards by passing center world positions via a StructuredBuffer and use the geometry shader to build a billboard facing the camera. The sphere is drawn correctly and I can figure out the UVs. Now I would like to light it but I cannot figure how...

I am currently trying to find an equivalent for the following equation: vec_res = inverse(VM) * (q * (VM * vec_input) * conjugate(q)) where VM is a standard view matrix , q is a normalized quaternion, and vec_input a vector. In the form: vec_res = A * vec_input; or vec_res...

I have 4D data (3D scatter points + color) plotted using matplotlib's mplot3d library. To aid in parsing how the cloud of points is distributed in space, I'd like to show a projection of the cloud across each of the 3 planes (XY, XZ, YZ) using a 2D histogram/contour plot....

I was reading and learning about coordinate systems in 3d and found that some people are using different explanations about rotation of coordinate system. What does it mean for 3d object to be drawn in coordinate system: 0 0 1 1 0 0 0 1 0 ...

In my app I load models from different files (format is the same) and they have different geometry: big, small, wide, etc. I have object and camera position hard coded and for some cases I don't see anything because camera not point to object. Maybe there is a way to...

I'm struggling to get a cube to render in opengl. When I pass in the MVP already calculated to the vertex shader it works fine, but when I pass in the model, view and projection then do the calculation in the vertex shader it doesn't show the cube. I'm also...

Is there a way to convert a world point into normalized viewport position ? How can I do that ? I saw how to convert world position to viewport, but not normalized viewport ... can you help me ? Thank you.

How safe frame is calculated in 3ds Max. I want to know the relationship between Viewport width and height, Render width and height(aspect ratio) in the calculation of safe frame width and height. My final goal is to find the distance between top left corner of the plane and top...

I am trying to do a figure similar to the one attached. I have exactly a (224x1) vector with dates (x-axis), a (10x1) vector with maturities (y-axis) and a (224x10) matrix with the values (z-axis). I tried surf(X, Y, Z) but I got an error ("data dimensions must agree"). How...

Relevant codepen: http://codepen.io/OpherV/pen/yNebep In my game I have a model of an alien tree. For each face of this tree I generate a pyramid (CylinderGeometry with 4 faces), and position it at the center of the face. Then I wish for this pyramid to be perpendicular to the face, so...

I have a mesh that has origin point at the bottom. I want to move it by -132 on Z axis. If I change the position of the Mesh it is on the correct position. But If I translate it on the Z axis by -132, the mesh is off...

I've tried numerous ways using linear-gradients to create several stripes layered on top of each other and have gotten very close but seem to be stuck on the top face. I'm trying to accomplish this using gradients be it linear or radial so that I can eventually upgrade them to...

I am trying to execute one of Daqri's AR demos, but I keep getting "Failed to initialize player's 3D settings" ...error every time I try to run the demo (Which is essentially a webpage). I am using unity 5.0.0f4 and even 4.5.3f3 (As a tried to implement a fix that...

I've, the last month, been following tutorials on a various pages (learnopengl.com) amongst others. I got to the lighting section (I created a loader to load meshes with Assimp first), my fragmentshader code is pretty much the same as the tutorials lighting ( learnopengl.com/basic_lighting). Frag code: #version 130 out vec4...

How to look at the front of 3D Model in WPF? I am confused to set X Y Z for LookDirection. I don't know what happens when I set xyz and I don't know where camera is looking at. I don't know the same thing for UpDirection. Below is my...

For an ellipsoid of the form with orientation vector and centre at point , how to find whether a point is inside the ellipsoid or not? An additional note that the geometry actually is with a=b (spheroid) and therefore one axis is sufficient to define orientation Note: I see a...

I have a texture I want to use for a TriangleMesh (it's a simple cube). Some parts of the texture are transparent. When I put the texture on the mesh, it's black. Is there a possibility to change that? I would like to make it transparent. Appreciate your help, thanks...

In regards of Marching Cubes, i have some doubts regarding its algorithm and implementation. I have gone through the excellent Paul Bourke article of Marching Cubes and also the available source code on the site, yet, i still encountered some problems in term of understanding as well as how to...

I'm trying to figure out the math to find a random point inside a cube. I have something small but it can't take into account the rotation of the cube. Here are some images of my results. Here you can see the cube is rotated to some degree but when...

I'm just now picking up jMonkeyEngine and I've encountered an issue I can't seem to solve. In the simpleInitApp method in the main class, I can use the following code to successfully render a box: Box playerBase = new Box(Vector3f.ZERO,1f,1f,1f); Geometry playerBaseGeom = new Geometry("playerBase", playerBase); Transform fixBaseHeight = new...

I am looking for an algorithm that given two meshes could clip one using another. The simplest form of this is clipping a mesh using a plane. I've already implemented that by following something similar to what is described here. What it does is basically inspecting all mesh vertices and...

I am trying to create a 3D room. What I am doing is that I am creating a 3D cube and then trying to changing the camera position inside the cube so that it appears as a room. When I make my coordinate vertices as 3 instead of 1 it...

I have a set of data arrays that are nx6, where the 1st 3 columns are the x, y, z coordinates of a trajectory and n varies. I have written a script in matlab that allows me to plot each point in succession and then make it into a movie,...

I have come into a problem recently when trying to rotate 3D objects. I am building a GUI and I have a separate figure where an object is plotted. In the figure, I allow the user to use MATLAB's built-in rotate button to move the object around. However, I am...

I'm new to OpenSceneGraph, and now I met a problem. When trying out a simple skybox program, it gives Warning: Could not find plugin to read objects from file "xxx.jpg" when calling osgDB::readImageFile(), and I can only see a white screen; Then I tried using osgviewer --image xxx.jpg in cmd,...

I'm currently learning C++ and OpenGL and was wondering how the below code is able to map a texture to a 3D object within a scene. The code currently works, but I'm struggling to understand it. //In the Pixel Shader. float pi = 3.14159265359; vec3 N = normalize (Normal); vec3...

I'm making a 3d game in java script and this image is not drawing. No errors come up in the console ether. It tells me it drew but I dont see anything. Its not a problem with the source. It tells me theres a wall there yet it does not...

So I want to program a 3d-mesh viewer in pygame, no other 3rd-party modules wanted (panda3d is perfect, but it's very complicated). My idea is: list_of_surfs = {'85 50':'70deg'} #the 85 50 and the dimensions of the #side/surf, and 70 deg of rotation to be able to see it, then...

I have a map gameobject, that has 8x8 childs, set up in rows and columns. The hero can go circular on the edges, ie from [0,0] to [8,0]. That part works good, but you can't see where are you going on the edge, so I've set up a script, that...

I'm trying to find a way to draw a wire sphere using LWJGL. I have seen that using GLUT I could use the function glutWireSphere(double, int, int), but what about LWJGL? is there any way to do that similarly? I was looking for that but I haven't found anything yet....

I want to rotate an image about the z axis using java. I tried to search for ways to do that but it involves complex matrix manipulations and it works on 3d models and stuff. I will resort to that if there is no other way but would like to...

I have the following code that draws a diamond in Three.js: var material = new THREE.MeshPhongMaterial({color: 0x55B663, side:THREE.DoubleSide}); var geometry = new THREE.Geometry(); geometry.vertices.push(new THREE.Vector3(0, 1, 0)); geometry.vertices.push(new THREE.Vector3(0, -1, 0)); geometry.vertices.push(new THREE.Vector3(-1, 0, -1)); geometry.vertices.push(new THREE.Vector3(1, 0, -1)); geometry.vertices.push(new THREE.Vector3(1, 0, 1)); geometry.vertices.push(new THREE.Vector3(-1, 0, 1)); geometry.faces.push(new THREE.Face3(0, 4,...

According to a book Physically Based Rendering: From Theory to Implementation. By Matt Pharr, Greg Humphreys (link, p. 86-87), surface tangent vectors are transformed as common vectors, using transformation matrix M, but surface normal vectors are transformed using . I wonder why scaling does make a normal incorrect, but doesn't...

I've been unable to find a way of producing the plot described in the title, does anyone know how to do this if it's possible? I'd like to plot a surface from a function, and plot points from a file, and have lines drawn between the points and the surface....

So I have a bit of a math problem. Here are the pieces. Input: Rot = Rotation (degrees). This is the rotation of the "player". This is also the yaw. Vel.X = This is the left/rightward movement that would be happening if it weren't rotated Vel.Z = Same as last...

I am new to Android and OpenGL both. I want to draw a series of 3D given points in android with open GL where last point should blink. I have drawn square, pyramid and triangle but still not able to draw above-mentioned thing. Easy method will be appreciated.

Refer to the attached image. I want to display the image in Matlab using the function surf(). However, I only want to display the region of the actual object without the background (the pale-green region surrounding the actual object which has 0 value). How to do that? I tried replacing...

I'm looking for a tool to display 3D scatter plots using JavaScript and found Highcharts' 3D scatter chart which looks nice. Only thing is that I want the chart to have a cubical form since all axis are from 0 to 10. Right now the X-axis is twice the size...

Hello I'm trying to build simple C function with external commands provide by library NPTrackingTools API #include <stdio.h> #include "mex.h" #include "NPTrackingTools.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { int ret1,ret2,ret3; ret1=TT_Initialize(); ret2=TT_FinalCleanup(); ret3=TT_Shutdown(); printf("Hello, World! \n"); return 0; } I tried the following compiler code...

I am creating a small 3d rendering application. I decided to use simple flat shading for my triangles - just calculate the cosine of angle between face normal and light source and scale light intensity by it. But I'm not sure about how exactly should I apply that shading coefficient...

Not much to it Java Windows 8.1 32 bit Still beginner 2D Thanks...

You can switch from Three.js Orbit Controls to FirstPerson controls without a problem. But when you go from First Person to Orbit the display gets stuck in a 'mousedown' mode. What do you need to do to go back and forth between First Person and Orbit controls seamlessly? The jsBin...

I am using PyQT for one of the first times, and I'm having trouble figuring out where a mouse click is in 3D space. Obviously it is not a perfect 1-to-1 mapping, but let's say that I click on a location (x, y, 0) on my QtGui. How can I...

i am working on a project that require a continuous 3D plotting using matplotlib. the whole project is complex, but i summarized the problem with this simple example: import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import time count=0 fig = plt.figure() ax = fig.gca(projection='3d') z...

I'm curious as to how games are written. For those who have a better understanding of how the latest-title, real-world games are written... Are 3d planes(?)/maps/grounds of a level created in 3D programs then just imported & loaded into the code IDE, or are they ever generated completely via the...

In my program I have an array of points with X; Y; Z coordinates. I need to be able to draw 3d model according to coordinates from this points and save it in file. And I'm stuck. Task seems to be not that difficult, it looks like I just need...

So basicly I'm looking for a way to calculate the x,y and z component of a vector using 2 angles as shown: Where alpha is the 2D angle and beta is the y angle. What I've been using uptill now for 2D vectors was: x = Math.sin(alpha); z = Math.cos(alpha);...

This question is from my last post, But I will just focus on a particular part, If I have a 3d matrix M, 256*256*124,and a plane defined by 3 points that intersect the 3d matrix, A,B,C, how to find the distance of all points in M to the plane defined...

I'm currently writing a 3D shader for a computer program, and I've run into a bit of a problem I'm hoping someone can help me with. The shader is designed to generate an N-sided shape in 2D space. The 3D program that drives the shader essentially passes you a set...

The goal is to reproduce this Bid-Rent graph in R: The challenge is to draw the projected circles. So far I got: The 2D part is created by the R code below with the traditional graphic system in base R: #Distance X <- seq(0,7,1) #Bid Rent Curves: Commercial, Industrial, Residential...

Do the rgl routines accept the use of "expression" for Greek letters and super/sub script for axis labelling? Something like xlab=(expression(paste("Lyman ",alpha,))) works perfectly well in a normal plot call but just seems to display "(paste("Lyman ",alpha,)" as my axis label in plot3d and decorate3d. If not, how can I...

When rendering a sky with a fixed texture in 3D games, people often create 6 textures in a cube map first, and then render a cube around the camera. In GLSL, you can access the pixels in the textures with a normal instead of a texture coordinate, and you can...

I am playing around with a simple code that generates a shaded sphere. I don't yet fully understand the math but I am figuring it out as I play with the code. I was wondering how one might implement specular shading into this based on this code. Any suggestions? for...

How to plot a imshow() image in 3d axes? I was trying with this post. In that post, the surface plot looks same as imshow() plot but actually they are not. To demonstrate, here I took different data: import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np...

Is there a way to plot a 3 variable implicit equation using sympy. Going by docs it has only support for implicit 2d plots. Or are there any other options for plotting a 3d plot using python where the equation can be an input from user

I have tried whirlyglobe sample code but it didn't work, can you check and make it working for android. " MapGlobeTestFragment " this one "fragment class" is missing for android sample and its not present in library.

I am creating a simple game in which I have a board which I am passing to many functions to change its values. Right now I am doing it like that: void play(int board[2][HEIGHT][WIDTH]); where HEIGHT and WIDTH are both defined using define. How can (should) I simplify it? I...

I am trying to write a python script for Maya that will copy keyframes from one rig to another. I have found objects and matched them up. What I am trying to do now is copy the keys from the original objects if the original objects have keys to be...

I have an AR scene that has one AR camera, an image target and 3d object below as. I create an .cs file and attach to ARCamera. I want to move AR object to mouse click position. I tried many codes for this. But I couldn't success it. I know...

This is my goal: Plot the frequency of y according to x in the z axis. These are my problems: I have a two columns array (x and y) and need to divide x into classes (p.ex. 0.2 ou 0.5) and calculate the frequency of y for each class of...

I've been banging my head on doing transformations in DirectX 9 and during debugging I finally noticed a problem, when calling D3DXMatrixPerspectiveFovLH(&projection, D3DX_PI/4, yRes/xRes, 1, 100); the first element (_11) of projection is #INF, which I'm pretty sure it should not be. This is directly after declaring this matrix and...

I'm trying to plot a line segment between the points [1,1] and [0,0] in the surface Z function x^2 + y^2, i've already plotted f with: using PyPlot using Distributions function f(x) return (x[1]^2 + x[2]^2) #return sin(x[1]) + cos(x[2]) end n = 100 x = linspace(-1, 1, n) y...

I've written a simple opengl running in my ubuntu laptop. It is a small solar system including the sun and the earth, the earth rotates around the sun. The problem with my program is the screen keep blinking continuously every time I try to run it. #include <GL/glut.h> #define SUN_RADIUS...

For starter, I know what a lightmap is, what to be gained by using it, and how to implement it. What I don't get is, if you have dynamically moving objects, which won't be able to generate a lightmap, you still need a light source to project their shadows. So,...

I wish to make a 3d array by appending each element to the array in a loop, but instead of getting a 3d array I just get a 1d array with more elements in it. I'm working in Python 2.7 I want to get labels = [1,34,u'te],[2,44,u've],[4,43,u'ht] My code so...

I'm using Ogre 3D 1.9, and I'm trying to load a mesh contained in a folder pointed by the resource.cfg file. The folder contains sub-folders, that separate the .mesh files, .material files and textures. Here's the content of the resource.cfg file: # Resources required by the sample browser and most...

I'm working on a problem that need to randomly generate and put convex polyhedrons into a cube/cylinder container at randomly chosen points without overlapping. I'm using three.js to get a graphic output. A demo. While putting a polyhedron, how to check whether it intersects with other polyhedrons? The convex polyhedron...

I can't find information online about the intensity rescaling of a 3D image made of several 2D images. I'm looking for the same function as imadjust which only works for 2D images. My 3D image is the combination of 2D images stacked together but I have to process the 3D...

I am having trouble setting the openGL origin to the upper left corner of the view. So, in my window resize handler, I do something as; // ox and oy are some offsets and width and height are the // required viewport width and height glViewport(ox, oy, width, height); glMatrixMode(GL_PROJECTION);...

I'm currently learning C++ and OpenGL and was wondering if anyone could walk me through what is exactly happening with the below code. It currently calculates the positioning and resolution of a shadow map within a 3D environment. The code currently works, just looking to get a grasp on things....

I have an xts object of data through time: > head(vixData[,2:8], 5) F1 F2 F3 F4 F5 F6 F7 2009-06-08 30.25 32.00 31.70 31.75 31.65 30.85 29.95 2009-06-09 29.10 30.95 30.95 31.15 31.10 30.40 29.45 2009-06-10 29.10 31.20 31.30 31.45 31.50 30.75 29.95 2009-06-11 28.10 30.60 30.75 30.90 31.00 30.20...

I have a 2D array Z that stores the height at that element's position. Other than using the method here in which I need to create array X and Y with the same size as Z, are there any simpler methods to create a 3D height map? The 3D surface...

I have set up openGL, so that the origin is at the top left corner. However, using gluUnProject to convert mouse coordinates to OpenGL coordinates, still gives me coordinates where the origin is at the bottom left corner and I am not sure why that is. So, OpenGL is setup...

I have something like this, and want to turn xlabels 45 degrees (it is going to be rather long text): a<-c(1:10) b<-c(1:10) c<-c(1:10) scatterplot3d(a,b,c, main="3-D Scatterplot",color="blue", pch=19, type="h", lty.hplot=2, box=F, scale.y=.5, lty.grid=1, lab=c(9,5,1), xlab="", ylab="", zlab="") ...

i really need your help since that i am fighting with the unknown for some time now. I am trying to draw a parametric surface on java 3d. The surface is being drawn if i a use a point array. Here is the code : PointArray lsa=new PointArray(length, GeometryArray.COLOR_3|GeometryArray.NORMALS|GeometryArray.COORDINATES); float...