It looks like you're new here. If you want to get involved, click one of these buttons!
Hey All,
I am working on some 3D stuff for a visualization class. I am hitting a slight road block, however, when it comes to "looking" at the 3D model I have made. I've tried a couple of things with matrix transforms but to no avail. Can any of you give some advice on how to get my model on the screen?
Comments
Hi @blmacbeth
If you look at the source of the 3D Lab example that comes with Codea, you'll notice the following:
perpective(fov) and camera(eyeX, eyeY, eyeZ, lookAtX, lookAtY, lookAtZ, upX, upY, upZ).
fov = Field of View, a "standard" value is 60
eyeXYZ is the eye vector (wherever you want your camera to be)
lookAtXYZ where it looks at (so 0, 0, 0 is you're looking at the center)
and upXYZ the up vector (usually Y or Z up, so 0, 1, 0 or 0, 0, 1)
That's basically all you need
Cheers
I'd just like to add that you'll also want to use either parameter or iparameter sliders for the fov.
also
Here's a small example that might help.
Alrighty. I have proven that I can view something in 3D. However, I cannot make a 3D object. Here is my code to make a 3D graphed for a visualization program I am working on. What am I doing wrong? The vectors in the main class are my tests and what not. That mesh is drawn in the graphed classes draw function as I was too lazy to copy and paste the matrices to the main (it also felt redundant).
Grapher3D class
I finally fixed the code and it works great! I added some stuff to control how it breaks up the graph, etc. you'll see.
Still needs lighting...