To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 6400
6399  |  6401
Subject: 
Animation - LDraw Object Classes - help needed!
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 3 Sep 2001 08:24:02 GMT
Viewed: 
370 times
  
So, finally I have made all the preparations to begin the work with creating the framework for LDraw Object Classes
aimed towards animation scripting.

My inspiration comes from the Borland Delphi world, but I'm open for other, easier, more flexible, better suited or
whatever systems you suggest.

Like almost everything in the world of LDraw, I want everything to be completely text based. At least initially. So,
even if we create files that act like DLLs*, they should be text based. *) Just an example, probably not applicable. The
system must be modular and text based so that anyone can add their own procedures to an object or class, and anyone
should be able to make utilities that understand the new procedures.

Just like TObject is the ancestor of all Delphi classes, I suggest a class called LDObject.

Now, how and where do we declare it?
LDObject1 = class (LDObject) // or something like that?
// Could be a Part, a Primitive (not likely though), or a [Sub-]Model.

The LDObject class has these properties predefined:
  Name: String;     // In this case: 'LDObject1', user may change it
  Index: Integer;   // 0-999, assigned by program, user cannot change. Sort of a pointer
  Color: Longint;   //
  x, y, z, a, b, c, d, e, f, g, h, i: Double;  // relative to parent object
  FileName: String; //hmm? I must have meant representing the object. I'm growing old...
  Visible: Boolean;
  // ChildObjects: List of Integer - maybe
  // ParentObject: Integer; // Index "pointer" - could also be name string,
  // // but that makes it even more complicated

In the library file, there should also be default value definitions, and, if possible, special treatment instructions
like:
Name := LDObject + IntToStr(NextFreeNumber);
if DefaultColorDefinedInCMDLINE(self.FileName)
  then Color := DefaultColor(self.FileName)
  else Color := 16;
But that's details just to keep in mind. Not the first things to implement...


We also need some movement and rotation properties.
With rotation, I don't mean like the static 0 ROTATE command, but rather the spinning movement.

Should the superclass LDObject should have any procedures, or are they more specific to subclasses? I leave it open
until I had some real examples.


Step Two: Subclass LDMinifig
I pick the minifig because it has all complicated issues I can think of right now.

It has to be declared so that it inherits all properties of LDObject plus has its own unique properties and must respond
to procedures like Walk.

LDMinifig1 = class(LDMinifig)
Any LDObject can have one or more child objects, but on creating an LDMinifig object, a chain reaction of creating child
objects should be triggered:

procedure(?) OnCreate
begin
  Create.LDMinifigLegL; // or LDMinifigLegL.Create; ?
  Create.LDMinifigLegR;
  Create.LDMinifigHead;
  // ... and so on
end;

As you can see, I still have very diffuse ideas of objects, classes, types, properties, and all that stuff. Don't try to
teach me; I've read it 30 times and still don't grok.

What I ask is somebody help me to make a system of library files with the definition and default values, and a proper
way to declare the objects in a unit-like file. Like I said, it doesn't have to be the Delphi syntax, maybe a more
simple will make a better and less demanding work?


TIA!
/Tore



Message has 1 Reply:
  Re: Animation - LDraw Object Classes - help needed!
 
(...) creating the framework for LDraw Object Classes (...) other, easier, more flexible, better suited or (...) Interesting. Eventually I want to include an animation scripting feature in the CAD program I'm developing (which happens to be written (...) (23 years ago, 3-Sep-01, to lugnet.cad.dev)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR