# Search:

Type: Posts; User: sueyllam

1. ## Thread: Turn a function plot in 2D directly into 3D

by sueyllam
Replies
9
Views
1,433

### The colors get much better if you keep track of...

The colors get much better if you keep track of the ModelView matrix and compute the normal and ray according to it and not have them fixed according to original position.
Here the code that does...
2. ## Thread: Turn a function plot in 2D directly into 3D

by sueyllam
Replies
9
Views
1,433

### Final Version in case anybody is interested

The code plots a surface with -1<=x<=1, -1<=y<=1< -1<=z<=1 in parametric form.
It allows rotating to see the surface from different viewpoints... Of course this could generalize to any ranges. The...
3. ## Thread: Turn a function plot in 2D directly into 3D

by sueyllam
Replies
9
Views
1,433

### I fixed the calculation of the normal and set the...

I fixed the calculation of the normal and set the order of x, y, and f correctly and still back and front sides white? any help??
Here is the final code:

#include <math.h>
#include <GL\glut.h>
...
4. ## Thread: Turn a function plot in 2D directly into 3D

by sueyllam
Replies
9
Views
1,433

### OK I defined different material colors for the...

OK I defined different material colors for the front and back sides but still get white for both sides even though the back has material color red...??

#include <math.h>
#include <GL\glut.h>
...
5. ## Thread: Turn a function plot in 2D directly into 3D

by sueyllam
Replies
9
Views
1,433

### Well I used lighting and defined it to use both...

Well I used lighting and defined it to use both sides of the surface and defined the normal at each vertex but what I get is the front surface and the back surface is invisible, what I want is to...
6. ## Thread: Turn a function plot in 2D directly into 3D

by sueyllam
Replies
9
Views
1,433

### Here is the code working after adding zooming and...

Here is the code working after adding zooming and rotation to the surface, but what I still don't know how to do is to determine the sides of the surface to be colored by 2 different colors in order...
7. ## Thread: Turn a function plot in 2D directly into 3D

by sueyllam
Replies
9
Views
1,433

### I think I found what is wrong, I had nothing...

I think I found what is wrong, I had nothing appearing because in 3d the camera is aiming at the -ve z axis not the +ve axis which I have been assuming translating by glTranslatef(0.0,0.0,-MAXF) will...
8. ## Thread: Turn a function plot in 2D directly into 3D

by sueyllam
Replies
9
Views
1,433

### I meant use glVertex3d instead of glVertex2d,...

I meant use glVertex3d instead of glVertex2d, that is draw the surface one point at a time. This is shown in the attached code.

Here is the 2D code which is working fine:

#include <math.h>...
9. ## Thread: Turn a function plot in 2D directly into 3D

by sueyllam
Replies
9
Views
1,433

### Turn a function plot in 2D directly into 3D

I have the following opengl app which plots 2d funxtions. I want to turn it into one for plotting 3D surfaces with min. changes that is maintain the drawVertex and just change the projection. I was...
Results 1 to 9 of 9