3d Modelling HELP PLEASE!!! ARRGHH

I am trying to make a 3d modeller and was wondering how I can implement a triangle maker with the user clicking to define vertices.
I know how to use gluunproject()
But How can I do this please help!!

By the way I want to add more than just one triangle I want the user to add unlimited number of triangles Plz help!!

help me please reply!!

There are a lot of open source modelling programs on the net. Check SourceForge, they have many.

Try this one: http://prdownloads.sourceforge.net/aztec/

-SirKnight

[This message has been edited by SirKnight (edited 12-19-2002).]

Thanks but I was just looking for ideas and sourcecodes. Have you ever looked at the source code for aztec modeller its complex and unreliable and doesn’t compile. And for source code HUGE!!!
More help Please
ANYBBODY??

case WM_LBUTTONDOWN:
userClicksLeft(x,y);
break;

userClicksLeft(x,y):
switch userMode:
case userWantsNewVertex:
vector3d newVertex = gluDoProjext(x,y);
scene.currentMesh().vertexList.pushBack(newVertex);
break;

with

struct Scene:
vector<Mesh&gt meshes;
int currentMeshIndex;
Mesh& currentMesh(): return meshes[currentMeshIndex];

and

struct Mesh:
vector<Vertex> vertexList;

now, for generating triangles, you expand the mesh struct, add a new userMode, and code up a method to find out if a user clicks on a specific point (hint: draw them with glPointSize(10) and every point with another color, read back the color at the specific pixel the user clicked, recalculate wich point that was, and voilà… then redraw the scene with normal view before swapping buffers )

create a struct Triangle: unsigned int v[3]; style, and make a “currentTriangle”, wich you fill per click with the index you clicked. when its filled (currentTriangle.size() == 3), push_back it in your Mesh::triangleList

and voilà…

I have made a modeler with wich I have done ALL models of a fun race game (that I’ve fully done too). (you can see a screenshot at www.z-oxyde.com)) To do a such program, I think you MUST have many years of use with most important softwares like Maya, 3ds or Lightwave. If not, your software might be not efficient and ergonomic, because you cannot understand what are the key feature that make it fast and reliable.

The best thing is to have a working environement where you can flip from front, side, top and pers view. In each, you can define an insert point wich is, in ortho views, the depth where you will input something. Screen is in 2D, so, to define something in 3d, you do it in an ortho view, on 2 axes, and in a specified depth.

To define a mesch, I’ve done a 2 step process : first, define vertices, second, build triangles between vertices. It’s very usefull. To modify the mesh, you can do lot of features to select a vertex, growth the selection, select a part of an object, select adjacent trangles, etc…

Well, after that, you must do a full features projection system for texture coords generation, normal viewing and editing, etc… Build some triangle is only a very small part of the work to build a good modeler. Build tools is a particulare thing.

Good luck !

Gaby

Well… I think I’m not so clean in my explanation.

Create a tools (or a key combination, it’s usefull) wich permit to move an insert point in 3D. For a z in depth, if you are on front view, you move define x and y fields by taking directly the mouse coords inverse multiplied by view matrix. When on side view, you define x and z of the point. On top, z and x.

Create a Vertice creation tools : in one of the 3 ortho view (front, side, or top), this insert point will define the position on the depth axes of the view.

For exemple : if we are one side view, the mouse is on the z and y axes. When the user clic you have :

new_vertex.x = insert_point.x
new_vertex.y = mouse.y
new_vertex.z = mouse.x

I hope that will help you !

Regards,

Gaby

that sort of helps me but is kind of confusing. By the way the website did not work. An example of this would help thanks!!

Originally posted by shanedudddy2:
that sort of helps me but is kind of confusing. By the way the website did not work. An example of this would help thanks!!

website works, you just has to realise that it accidentally highlighted a ) in the url… delete that, and voilà, it works

Check www.loiv.torun.pl/~stinger

there’s sample of my program,
but don’t get confused, code is
someway <specific> , but you should get a hint

Originally posted by shanedudddy2:
Thanks but I was just looking for ideas and sourcecodes. Have you ever looked at the source code for aztec modeller its complex and unreliable and doesn’t compile.

Maybe you already know this, but you should follow the instructions from the BuildingAztec.html file from cvs when building Aztec, not the one currently online @ the sf.net project page (which is out of date).

And for source code HUGE!!!

No, 70.000+ lines of code isn’t huge at all… it’s quite much, but not huge

btw. The ‘unreliable’ parts are (mostly) going to be fixed next year (using a new super-duper-ultra-good-and-modern-kicks-butt GUI front-end (which isn’t in cvs yet))

It’s very difficult to explain such ideas without writing many pages… Well, perhaps you’d better parse how a simple modeler work and redo it. We never have one way to build a such tool : so, focus on what you have to do and try lot of modelers to grab the basic ideas. My modeler is running on Macintosh without accelerator (the software renderer is hand writed), so, I cannot bring you the source…

Yes, here the exact url : www.z-oxyde.com
and for fun, you can see a physic simulated structure : www.z-oxyde.com/research/download.html

Regards,

Gaby

Yep you’re missing some important and fundamental concepts.

Modellers tend to allow the input of positions through the intersection of the eye->mouse ray with some plane or existing objects.

There is no way to unambiguously input a 3D vertex with the simple position of the 2D mouse without some additional concept to supply depth. A plane of input is typically used with possibly a snap to grid in operation.

More complex objects are constructed by extruding simply input objects or performing other more complex operations like the construction of spheres, cones, cuboids or other solids. These can often then be deformed & subdivided. Models are NOT created by supplying triangles with 3 vertices each for the entire model, that would be tedious and inefficient.

It is advisable that you learn several existing modeling packages before writing a new one. You should probably try harder to learn (and maybe one day contribute to) an existing project, there are several open source modelers out there now, please don’t write another one unless you intend it mostly as a learning exercise.

ARRHHH you people don’t give me any of the answers I want. By the way all shapes are made of triangles including polygon which make up nearly all shapes.

Could some body please just give me source code on how to do this thanks!!

Dorbie,

All what you said is true. Sure, a modeler is not only a vertices/triangle setup interface : for very low poly object, it is not uneficient. It’s a good basis. That is the request of this thread.

In my post, I’ve exposed exactly how to build a system to have the missing coords wich is, in all cases, the depth coord. It use exactly working plane wich are x=incertpoint.x, y=incertpoint.y, z=incertpoint.z. But I’m agree, my explanations are confuse.

So, here a new explanation, in more step by step form :

1- Create a environement where you define 4 camera :
Front, Side, Top, and Perse Camera
Make it switchable by keys (F1,F2,F3,F4 for example). Front, Side, Top must be othogonal projection, and must be zoomable / movable.

2- Create a tool, for exemple by pressing F5 key to select it, that permit to enter a “incertpoint”. You must draw it as 3 long lines in red, for example.
When you clic in the view with this tool, it will move the point taking care of wich camera is current.

Front : you map mouse coords like this :

incertpoint.x = x;
incertpoint.y = y;

side : you map mouse coords like this :

incertpoint.z = x;
incertpoint.y = y;

Top : you map mouse coords like this :

incertpoint.x = x;
incertpoint.z = -y;

Pers : more complexe : but for a 3 button mouse, button 1 move on X axe, button 2 move on Y axe, button 3 move on Z axe.

So, at this time, you have a tool wich permit to move the incertpoint every where in the space.

3 - Create a tool to create a vertex :
For this, you will take the incertpoint to define the depth.
When in Front camera :
nv.x=mouse.x;
nv.y=mouse.y;
nv.z=incertpoint.z;
When in Top camera :
nv.x=mouse.x;
nv.y=incertpoint.y;
nv.z=mouse.y;
When in Side camera :
nv.x=incertpoint.x;
nv.y=mouse.y;
nv.z=mouse.x;

4 - create a tool to create triangle : you can do a simple picking vertice system. You count the number of picked vertices, and when 3 are picked, create a triangle.

If you are not able to build something with this explanation, you’d have to start by the biginning : learning a 3d package, learn to build interactive tools, learn the building process of data, etc…

We cannot say more… I’m working in 3D graphics from many years, i’m daylly using Maya and coding OpenGL, so I can do the work for you, but I cannot explain all this in few words !.. :wink:

Regards,

Gaby

Thanks Gaby. By the way I have 3ds max 4 and use it all the time along with other asorted modelling tools.

I know how to get the x,y coordinates of the mouse converted into x,y,z world coordinates.

But what I need is a routine that can build as many triangles as the user wishes.
As many as 1 triangle up to 2,000,000.
I know I will have to define new integer and add loops etc. But could somebody please help me with this routine PLEASE??

Step 1. Learn to program.
Step 2. Learn OpenGL
Step 3. Hard work
Step 4. Bug everyone on OpenGL advanced forum
Step 5. Modeller!

Please go back and do steps 1-3.

Better yet, hire someone with the ability. Your project will move faster.

Thanks you all for giving me no help whatsoever.

Nobody seems to have the answer so I guess none of you guys really know or…

…YOUR ARSEHOLES