Slashdot Mirror


Designing Computer Animation Software?

reversedNormal asks: "I would like to write a full fledged 3d-Animation Software package from scratch. Yes, I know, a VERY daunting and time consuming task. But I have a very good understanding of 3D mathematics, physics, and computer graphics in general, plus a solid foundation in computer programming. To give you an idea, this package will be similar to Maya, 3DS Max, etc... in many respects. The question is, what is the best programming paradigm to use for such a project? I have all of the major concepts, and relationships in mind, but refuse to write one line of code until I have a good design plan. How does a professional programmer approach this design task? Ultimately I would like to be able to tie it into any number of different operating systems, graphics API's (OpenGL, DirectX, etc..), and so on. What are some good ways to do this?"

"Essentially I want the core of the software to be written in Standard C++, and then be able to tie into the Win32 API, or X, or QuickDraw (etc.) for display and input. The main concepts, such as procedural 2D and 3D geometry, 3D geometric transformation, polygon modeling, NURBS modeling, subdivision modeling, keyframe based animation of parameters, motion capture control of parameters, physics-based animation, sound synthesis, texture-mapping, lighthing, rendering, and so on are generally abstract ideas that do not need to depend on (but can certainly take advantage of) any particular API or environment. Of course, the idea is to eventually visualize the abstraction onto the screen, allowing the user to interact via the 2D pointer and keyboard input, and ultimately rasterize it, which will mean turning to various operating system standards. It will also be open as a plugin host and have a built in scripting language. Any design suggestions? I know that this is probably the most intelligent audience to communicate with, and any feedback would certainly be appreciated"

15 of 351 comments (clear)

  1. Scripting Language by Hal_9000@!!!@ · · Score: 4, Insightful

    For your builtin scripting language, may I suggest you *not* invent your own, especially for a small project. If it were me, I'd create a Perl module (probably a class of them) and use those for the scripting. That way your program has much greater power than it would with a custom language (think web-based 3D apps) plus it reduces learning curves. Think AutoCad/Lisp.

    If you're going to enter the big, bad world of 3D, the only way you're going to get noticed is if you can offer something really special. And not having to retrain all your programmers in a new language is something special. Being able to give an artist a copy of "Learnig Perl" and having them go to town is a lot better than trying to give them some documentation written by a programmer at the last minute.

    --
    My email is real.
  2. Needs a lot of experience by coljac · · Score: 5, Insightful

    My intuition says that there is years of work in this project. And, you ask, how does a professional programmer approach such a task? This kind of project is difficult and expensive even for teams of professionals with a lot of money behind them. They start with whiteboards, and use cases, and specs, etc.

    If I were you, the first thing I would do is identify a very small subset of the functionality - say, the ability to parse and view a .mdl file - and try that first. Perhaps there's a need out there for a model viewer. A project of the scope has a chance of completion, and if you're still enthusiastic at that point you can expand the scope of your app, building on the code you already have.

    Again, I'm sure you're smart and understand coding and the right physics, but the one thing the experience of a professional programmer would give you is a sense of the scope of this task.

    --
    Everyone knows that damage is done to the soul by bad motion pictures. -Pope Pius XI
  3. A Few questions for you... by Schnapple · · Score: 5, Insightful
    Although your question was very specific in some respects, it was vague in others. Possibly purposely. Still, I have a few questions of my own for the original poster:
    1. Is your intent commercial software, free software or other?
    2. If your intent is free software then are you thinking Open Source?
    3. If your intent is commercial software, then why do you think this product would be any better than the other commercial packages out there?
    4. What is the overall goal for this - professional quality animation? Movie or TV quality work? Video Game design?
    5. Are you working alone?
    6. How is it that you will have the time to devote to this? What makes you think you will finish?
    7. And finally, if it turns out that you are an individual from a commercial organization willing to undertake such a tremendous task in a crowded field with such strong players, why do you think Slashdot will be a good place to get meaningful advice?
    Don;t get me wrong - I'm not trying to slam you or your idea or anything but these are the questions that popped into my head when I read this. I know history is filled with projects like this but for every Linus Torvalds who sits down and makes his own OS (and yes I have read the GNU/Linux FAQ) there are thousands that get 10% in and say screw it.
  4. Have you considered C# by egg+troll · · Score: 4, Insightful

    As much as FSF advocates are pained to admit it, C# is going to become the de facto programming language in the next few years. By writing your program in C#, you'll be the first 3D animation package to use this, and take advantage of the power of .NET. Since there are already several packages similiar to yours, you have to do things like this to make your project stand out.

    Good luck!

    --

    C - A language that combines the speed of assembly with the ease of use of assembly.
  5. if you have to ask slashdot... by yorgasor · · Score: 5, Insightful

    I think this is one of those situations where if you have to ask slashdot, you're not up to the challenge ;)

    --
    Looking for a computer support specialist for your small business? Check out
  6. For what purpose? by tc · · Score: 5, Insightful
    A fully-featured 3D animation package is pretty damn huge. What is your intended purpose in building your own, rather than using an existing package? I assume that it is simply for fun, or perhaps you have a more ambitious goal of creating an open source 3D modelling package that might be a replacement for Max, Maya et al?

    If you are intending a serious replacement for professional packages, perhaps you need to talk to some of the users of those packages. I'm sure some game developers (just as myself) and animation folks lurk on Slashdot, but to get really great feedback you really ought to go to a more special purpose forum.

    That said, some things I'd consider if you're planning a truly professional quality package are:

    - Support and documentation. Especially really great documentation and samples. Plan a lot of time on this. Getting this piece right will pay for a lot of fuckups on the rest of the design.

    - Extensibility. Every pro user I know uses an array of in-house extensions, for everything from custom data format importers and exporters to plugins for procedural geometry, custom shaders, special lighting models, and a whole slew of other things. Make everything scriptable, overrideable, and customisable. Consider writing the bulk of your standard features using the same toolkit people will use to write plugins, because then they serve as sample apps.

    - Consider providing compatibility modes for people migrating from other pro packages. Artists get very set in their ways. Unless you have a truly revolutionary and more productive UI, follow some of the existing conventions, or at least make it an option.

    - Provide a batch processing mode, so that offline tools can invoke the power of your package without firing up the whole damn UI. In the games business, we have a lot of build process running on our artwork from assorted batch files, Perl scripts, and whathaveyou. I'm sure the same is true in other pro environments too.

  7. Incremental work. by Peaker · · Score: 5, Insightful

    An important thing to remmember, especially for motivational projects (projects that require a lot of motivation to keep going), is to write code incrementally.

    One of the best methods I know to write code incrementally is to rapidly model it in a Rapid Development language such as Python.

    Since I get excited by seeing results quickly, I'd probably start by deciding on a GUI toolkit, and find some Python bindings for it. Perhaps an OpenGL GUI of my own, in any case, that's where I'd start. Whatever excites you the most (Perhaps rendering ray-traced images of simple objects excites you, and you can start there), is where you should start. As long as you're excited about what you're doing, you can easily keep on going.

    Then, when you have a GUI (Or a simple renderer for that matter), you need to generate "stubs" for other components. There are various meanings of the word "stub" flying around, so I'll explain mine: A simple replacement of the interface a software component, that is trivial to implement, lacks any of the functionality, and is intended to later be re-written.

    This enables you to work on an exciting Skeleton of your program, that lacks almost all of the functionality, but there is already a bit of something very exciting to you, and perhaps to others who share your interests, to work with.

    Notice this is the same method used in the early development of Linux.

    Linus provided a very simple Skeleton of a Kernel, with either stubs or extremely naive implementations of almost all kernel subsystems. This is much better than the alternative, of trying to create the 2.4.19 kernel, component by component, from scratch.
    Linux 2.4.19 shares very little in design and in code with Linux 0.1, and the actual implementation decisions of Linux 0.1 don't really matter at all now.

    This is why I emphasize that you should start before you know exactly where its going, because there's a good chance you'll be stuck planning it forever, if you try to get it all right in the first time. If you don't bind yourself to backwards compatability, it doesn't really make a difference what kind of design error you make now, it can be corrected with time and with rewrites. Don't worry - rewrites are much shorter than the original designs and writes, as they come after a lot of experience, and can often reuse most of the code.

    Keep excited, start coding. Whenever there are tidbits of work you don't like doing, but must, keep in mind how the great cool exciting things that depend on it will look like.
    Don't code without design, but do code what little parts you know the design of already.

  8. I just considered C#. by NFW · · Score: 4, Insightful
    Three weeks ago I would have laughed at this suggestion. But, three weeks ago I'd never messed with C# and the .Net API. I figured they were a necessary evil though, and set about learning them.

    Today I have a nifty little directed-graph editor with cut/copy/paste, a palette of nodes to be drag-dropped onto the graph, a property window for selected objects, and multi-level undo/redo. I've written 4-5 such things in the past using C++ (I have this digraph fetish, you see) but I never got near as much done in three weeks. The timeline really impressed me.

    Other environments may be just as effective, of course. I've only dabbled with java and smalltalk, so I'm not in a position to compare. I just know C# and .Net make for a pretty productive platform.

    And no, I don't work for MS. In fact I've loathed them since bundled their email application to their (monopoly-holding) operating system, thus both tying and dumping, and thus putting a previous employer of mine out of business. That's a pervasive rant though, so I'll stop here. :-)

    Anyhow, in spite of its birthplace, C# and .Net will be the foundation for my next couple of personal projects, and possible for many more, until something better comes along. I really like what I've seen so far.

    The lack of multiple inheritance bugs me, but it's less of a problem than I'd expected, and it also presents an interesting challenge.

    --
    Build stuff. Stuff that walks, stuff that rolls, whatever.
  9. Re:First things first. by scott1853 · · Score: 4, Insightful

    Pfff. What are you? A professional.

    Real developers jump in and just write.

    Then when you're done, you write it from scratch again after seeing all the mistakes you made the first time.

    Then you write it a third time and add comments since you can't remember what the hell you were thinking at 3:00AM on the last rewrite.

    You think I'm wrong? Look at Windows CE.

  10. advice backed by practical experience by NFW · · Score: 4, Insightful
    [...] those ideas are usually not backed by a lot of practical experience.

    True, but if he's willing to separate wheat and chaff, there's probably enough people here who know what they're talking about that asking here will not have been a waste of his time.

    Especially if he's not discouraged by the e-holes ridiculing him for thinking big. While it's true that he probably won't realize all of his goals, before he's done he will have learned a lot and had a lot of fun. What else matters?

    Anyhow, I have a bit of experience (and some of it with a not-completely-unrelated project), so I thought I'd chime in.

    First, not coding yet is a good idea, and one that's lost on a lot of people. Think first, design, plan, write down your designs and plans (the very act of writing forces you to think about them more), and re-read them to think about them some more. Better yet, find some like-minded people to critique your designs and plans. They'll see things you won't.

    Changing designs is easy and painless when you've only invested a couple paragraphs. It's a huge pain in the ass when you've invested hours or weeks or months.

    I used to work for a manager who believed that with a good design document, you could hire a semi-talented high school student to do the coding. I think that's design documentation beyond the point where diminishing returns sets in, but on the other hand, you I also believe that if you know what it is you're going to create, you can't write too much design documentation. XP and "agile programming" are great for situations in which the client changes the requirements regularly, but if you have a clear picture of what you're creating, it's worth spending lots of time on documentation. In my experience it saves far more time than it costs.

    Design the user interface, and write that down, in detail.

    Do a high-level design of the whole system - what are the objects, what are their responsibilities, and how to they communicate?

    For each class, do a detailed design. How does it carry out its responsibilities?

    Then re-read the whole thing and look for issues that you didn't see when you started. Have a teammate reread the whole thing and look for issues. Look for assumptions you didn't know you had. Look for objects that have been tasked with doing things that they can't do with the information or interfaces they have available.

    Then figure out a game plan, a timeline, that will get you a minimal application with at least some usable functionality. That gives you a gratifying achievable goal to shoot for, and it gives you something functional to (hopefully) help keep you inspired.

    Good luck.

    --
    Build stuff. Stuff that walks, stuff that rolls, whatever.
    1. Re:advice backed by practical experience by PingoSvin · · Score: 4, Insightful

      Hey, with all due respect, that kind software development died along with the dinosaurs. It got waterfall written all over it.

      Design the user interface, and write that down, in detail.
      How about drawing a quick sketch, hack together a quick prototype, realising that in just a week you'll have a much better idea of the system you're writing.

      Do a high-level design of the whole system - what are the objects, what are their responsibilities, and how to they communicate?
      How about skipping that part entirely, realising that you're not going to get the architecture right upfront anyway. The architecture is going to evolve through a number of refactorings, not through some superhuman designprocess.

      For each class, do a detailed design. How does it carry out its responsibilities?
      How about realising that would be a complete waste of time, as you'll once again be much smarter after just week of codewriting. Here's some

    2. Re:advice backed by practical experience by richie2000 · · Score: 4, Insightful
      the guy who asked the original question does not have a lot of experience in software development

      I didn't interpret it like that at all, he claims to have:

      a solid foundation in computer programming.

      He just wants more input on this particular task, probably since he has never put all of his experience in 3D graphics, maths and programming together in one single big-ass project before and wants to minimize the number of false starts. That's my take on his request anyway, I think it's actually a little skimpy to give any really solid advice on. One thing I'd say is to not go it alone. Very few people have the necessary skillset and experience in everything from project management, coding, 3D graphics, software development, documentation and the rest to be able to pull something like this off on their own. He might have, but odds are he hasn't.

      You can't refuse to learn the piano and demand a record deal first.

      Sure you can, if you have nice tits or are willing to undergo minor surgery. :-)

      There's a reason why commercial software development rarely is more organized than private hacking.

      Oh, it can be a LOT more organized. It might just not always help. :-) Microsoft, to name one, has very organized software development methods and employ lots of testers, internal quality tests, code audits and whatnot but still manage to miss out in the basic design - the very area you seem to play down.

      It's silly to expect that planning can replace experience.

      And it's silly to expect that coding skillz and experience can replace a good design.

      --
      Money for nothing, pix for free
  11. Cool idea, but... by p3d0 · · Score: 4, Insightful
    Hi. I'd like to build myself a television. I know all the features I want to have (colour, brightness, and contrast controls; coax, RCA, and SVGA inputs; 16:9 aspect ratio; light weight; 35" diagonal). I'm wondering, what approach should I use to build my TV? How do the pros do it?

    I hate to be a downer, but that's way too big a question, and too fundamental. It's a catch-22: the fact that you are asking this question indicates you probably won't be able to accomplish the project.

    If what you want to do is try your hand at designing a 3D modeller, I'd say you should fork or join (no pun intended) an open-source project. If you don't like some of their design decisions, then redesign those parts.

    OK. Having said all that, I'm actually going to try to answer this question as best I can off the top of my head. Beware: this is a brain dump, and that's how it will read...

    Start with the interfaces. They are everything. Without good interfaces, you find that the development time for a project with n lines of code will grow as n^2. With good interfaces, it's more like nlogn. I don't know much about 3D modellers, but I bet it will get big enough that this will matter. If your brain is too small to design all these interfaces at once, try to design as many as you can, and then start writing prototype implementations, but be ready to chuck them when you figure out their weaknesses; after all, that is why you are writing them.

    For each interface, ask not what facility that interface provides, but rather what information it hides. That is, what changes could occur behind-the-scenes without requiring corresponding changes to the caller of that interface? If you can't describe in one simple sentence (with no "ands" or "ors" in it) what an interface is hiding, then it's no good, and you need to take another stab at it. (Of course, I didn't think up this information hiding thing myself.

    As you design your interfaces, identify those that are truly fundamental (ask yourself: would every conceivable 3D renderer need to be able to do this?), and separate them from the others that contain some of your own personal choices. The former are your base interfaces that should (in theory) converge toward the ideal design, such that you feel less and less need to change them as development progresses. The simplicity and stability of these interfaces will determine the flexibility of your design. Their header files should be physically segregated from those of the other less-fundamental interfaces.

    Then, remember to think big and code small. By that, I mean you should brainstorm while writing your interfaces, and design them so they could accomodate every plausible implementation; then, implement them in the simplest, most straightforward way you can. Churn out those prototype implementations with a focus on the shortest path toward correctness. Worry about everything else later; thanks to the flexibility of your interfaces, you can change any of the implementations later. This approach prevents premature optimization, and keeps you from writing lots of intricate code you don't need.

    Recognize when you have opposing forces on each side of one of your interfaces (ie. the caller and the implementor), and split that interface into two. That way you can give both the caller and the implementor an interface they like. (That's described in my thesis--chapter 4--and the PowerPoint slides on my web site.)

    When you don't know how you want to do something, see if you can make an interface that hides that decision. That way you don't need to think about it now; punt the decision until you have enough information to make a good choice. If there's no obvious "best" implementation, then that may be something you'll want to change later anyway, and you'll be glad you made an interface to hide it from the rest of the system.

    I have only just barely scratched the surface here. This is a truly vast question you have asked.

    Good luck with the project.

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  12. Re:Check out OGRE ... by p3d0 · · Score: 4, Insightful

    Unless I'm greatly mistaken, OGRE is nothing like a 3D modeller. It is a 3D realtime (ie. game) rendering engine.

    --
    Patrick Doyle
    I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
  13. Sorry Mr. Linus, writing an OS is a stupid idea... by Brian_Ellenberger · · Score: 5, Insightful

    Mr. Linus, it is my understanding that you intend to write your own operating system from scratch. I just want you to know your "Linux" kernel is a stupid idea. Why don't you just buy Unix from one of the many vendors out there? It is a waste of your time and resources to try and reinvent the wheel.

    There are many things I have written that have been "reinventing the wheel", from a merge sort to converting a Windows BMP to JPEG. But I learned a ton from doing it. Heck if he just wants to write something just to learn more about 3D modeling, more power to him. And you never know if in 5 years we will be raving about a new open source 3D modeler giving 3DSMax a run for its money...

    Brian Ellenberger