Jump to content


Modeling a liver with opengl primitive commands


11 replies to this topic

#1 like_gobeawan

    New Member

  • Members
  • Pip
  • 3 posts

Posted 30 June 2003 - 09:16 AM

Hi,
i'm quite a new programmer in opengl. i want to model a liver and other irregular shape objects using primitive opengl commands, without relying on available higher API and software such as Maya, 3DMax, etc.
i would like to see some sample in C/C++ implementation. any one can please help ? thanks a lot !

#2 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 30 June 2003 - 02:21 PM

what do you mean by sample code ? code that shows you how to render primitives using opengl ? i could provide you with that. i could mail it to you... let me know...
If Prolog is the answer, what is the question ?

#3 like_gobeawan

    New Member

  • Members
  • Pip
  • 3 posts

Posted 30 June 2003 - 03:52 PM

yup, i would like some sample code on rendering irregular shape 3D object, eg. liver, phone, animal, etc. which is modeled using OpenGL basic command only, not relying on the available 3D modeler such as Maya/3DMax.
would it be feasible ? afterwards, i need to animate the objects modeled.
thx for the help !

:) :D :)

#4 baldurk

    Senior Member

  • Members
  • PipPipPipPip
  • 1057 posts

Posted 30 June 2003 - 05:20 PM

I have three points:
  • It is possible to model anything, and to animate anything, simply using OpenGL commands because even if you do use Maya, 3DSMax etc, you still need to feed the data into OpenGL commands
  • It isn't practical to draw more than a VERY simple object manually. You need to figure out all the co-ordinates and type them in. It's hard to do and harder to maintain. Like writing your whole app in ASM.
  • Why a liver? why not a heart, spleen, stomach, small intestine...
that's about it :)
baldurk
He who knows not and knows that he knows not is ignorant. Teach him.
He who knows not and knows not that he knows not is a fool. Shun him.

#5 davepermen

    Senior Member

  • Members
  • PipPipPipPip
  • 1306 posts

Posted 30 June 2003 - 09:37 PM

i don't suggest it as well (read it over on nutty.org, too:D)

use a modeler..
davepermen.net
-Loving a Person is having the wish to see this Person happy, no matter what that means to yourself.
-No matter what it means to myself....

#6 keless

    New Member

  • Members
  • Pip
  • 2 posts

Posted 05 July 2003 - 06:06 AM

The reason you dont want to handcode the object is because anything larger than a cube requires a great number of lines of code. And they all look like this:
glBegin(GL_TRIANGLE_STRIP);
glVertex3f(1.0f, 1.0f, 1.0f);
glVertex3f(3.0f, 246.0f, 234.0f);
glVertex3f(246.0f, 234.0f, 2465.0f);
glVertex3f(45.0f, 543.0f, 65.0f);
glVertex3f(1.0f, 54.0f, 634.0f);
glVertex3f(234.0f, 524.0f, 1.0f);
glVertex3f(2654.0f, 234.0f, 1.0f);
glVertex3f(1.0f, 352.0f, 1.0f);
glEnd();

Or something to that degree, but with less spastic numbers. Now imagine trying to come up with the verticies for a 1000 poly model. (thats 1000 triangles, so if you were to do it with GL_TRIANGLES, 3000 glVertex3f() calls) What a nightmare, huh? So you need to let the artist make the object, and instead write a class that will load in that object and draw it efficiently. This is much easier to do.

I dont know why you dont want to use models made by professional modeling programs, but perhaps its because you want to make them yourself and you dont have the money for 3DS Max? First of all, there are many models people have made which they have given for free use on the Internet. Apart from that, there are also openSource modelers that you can use for free.

Hope this helps.
I liken myself to an amazing man-child of DOOM!!

#7 like_gobeawan

    New Member

  • Members
  • Pip
  • 3 posts

Posted 05 July 2003 - 06:34 AM

hi all,

thanks a lot for the reply. in the end, i decided to use 3dmax to model the objects i want, then use a opengl loader for 3dmax format file. (give up... nobody recommend me to use opengl itself =p )

initially, i thought that by using opengl itself to model the object, i don't have to convert the 3dmax / maya codes into opengl to be manipulated. the project i want to do is to make real time user interaction on the model.

so by using opengl to model the object itself, it enables me to store the object data in my data structure, and render it faster in C++/C# implementation.
right now, i'm still not clear about the project design and feasibility by converting 3dmax model into opengl. anyone would like to comment or suggest something ?

:blink: :rolleyes: :)

#8 baldurk

    Senior Member

  • Members
  • PipPipPipPip
  • 1057 posts

Posted 05 July 2003 - 07:37 AM

There is no way to draw anything in OpenGL, without OpenGL commands. The easy way is to use the data from the model file, and pass it to OpenGL via appropriate commands. The hard way, and never used way, is to manually do it.
baldurk
He who knows not and knows that he knows not is ignorant. Teach him.
He who knows not and knows not that he knows not is a fool. Shun him.

#9 Ed Mack

    Senior Member

  • Members
  • PipPipPipPip
  • 1239 posts

Posted 12 July 2003 - 03:17 AM

Here's a .3ds loading openGL dooda:

http://www.home.no/a...pron.htm?tut_gl (scroll down)

Need to sleep,

Ed Mack

#10 Ed Mack

    Senior Member

  • Members
  • PipPipPipPip
  • 1239 posts

Posted 13 July 2003 - 05:19 AM

Here's a really good tutorial on loading .3ds files in C (I plan to use it too) :D

Sorry, look below (delete this post please)

Ed Mack

#11 anubis

    Senior Member

  • Members
  • PipPipPipPip
  • 2225 posts

Posted 13 July 2003 - 06:02 AM

thx for the link, i'll certainly read through it
If Prolog is the answer, what is the question ?

#12 Ed Mack

    Senior Member

  • Members
  • PipPipPipPip
  • 1239 posts

Posted 13 July 2003 - 10:26 PM

Ok, two more (that I think are better):

http://www.the-labs....DS-details.html
http://www.xbdev.net...ats/3ds/3ds.php





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users