JOGL - Hard coding a complex 3D model?

Hello,

What’s the best plan of attack if I wanted to hard code a complex 3d model, like a lion or a blade of grass?

If I were to make a lion, would I start with one triangle and keep adding more to form a foot, then more and more to form a leg etc? Or is the a better way of doing it? Either way it seems like it’s going to take a lot of effort working out the 3d coordinates for each point :frowning:

I have to hard code for a uni project, so dI’m not allowed to use 3d modelling software

Thanks

I’d attack a problem as if it were an architectural drawing : do front, side and top views of some very simple object. A lion sounds pretty ambitious,
a blade of grass sounds too unimpressive.

Under no circumstances take on anything that you could not build out of say 12 blocks of lego or 12 simple 3d objects ( square, pyramid, ball ).
one option is to visualize the while thing before hand, plot out the points and tweak for fixes.

A more professional way would be to make a minimalistic editor that makes the square, rectangle, pyramid and ball objects / or plotpoints, and allows you
to move them around in 3d space, and finally save the positions, allowing you to load / display the mode from raw data.

So attempting something like this

http://www.red-zombie.com/blog/wp-content/uploads/2008/04/lion2.jpg

Would be waaaaay too complicated? It certainly looks it :stuck_out_tongue:

I have to do an ‘impressive animated 3d scene’, so I was thinking a lion walking through grass blowing in the wind. No?

[quote=“jackcharlez,post:1,topic:35100”]
This is a very strange assignment; an impressive animated 3d scene but with hard-coded data? What is he trying to teach you? ???

Anyway, my instinct would be towards procedural modelling. All the different trees in 4bidden Fruit for example are all grown from fairly a simple formula which could easily be adapted to 3D. A forest of non-identical trees swaying in the wind would be pretty impressive!

Yeah, very odd.

Hard-coding vertices isn’t going to be much fun or produce decent results. To get anything half-reasonable you’re going to go for something largely generated (possibly from a small set of hand-crafted input data).

One option could be CSG modeling, so your actual hand-crafted data is very high level (brown sphere at x,y, etc.). but a proper CSG implementation is pretty complicated. Another approach might be something image based - heightmaps are an obvious approach (where your input is a greyscale image turned into a 3d height field), or you could take regular 2d sprites and extrude them into solid 3d objects.

Yeah, procedural content is the way to go. For one thing, it’ll give you a lot more to write about for your assignment than sitting and typing in vertex data. A couple of ideas:

  • Darwinia-style landscape scene. A simple random heightmap, some fractal trees, fields of swaying grass, etc. It’ll be difficult to make it look realistic, so you’re best to stick to obviously computer-y looking stuff
  • Exploration of the internals of a Menger Sponge. A high-speed, swooping, twisting path through the internal structure at smaller and smaller scales, trippy feedback textures etc. Bonus points if you can make people queasy

One way to hard code it, would be to write a python script that converts the 3d model into a java program that compiles! Animation would be a bit harder however, but doable if performance is not too much of a problem (aka almost immediate mode).

If you do want to go for the CSG approach then I suggest using voxels. Voxel-based height-mapped terrain using Perlin noise can also look very cool.