log.txt is a journal of bugl4d. Contains thoughts/notes/list of coding done. Log start. Jan 1, 2002. Started c4light Added a Distance function to c4Point Added a Square function to c4Point removed c4PointC::add c4Light has Blend() for blending algo Light() for public use; actually lighting the vertex. c4Light- omni-directional light done. - Log Date Jan 2, 2002. Developed a generic vertex lighting model. Kicked Global and Spot lights. This light model uses omni for everything. Will have light reflection, shadows. Kicked c4Polygon from the Things To Do list. Designed the model structure. Has vertex4C list. Has Light list. Will use STL to get started with the variable structure. Implement a template linked list in future ? Takes vertexes and local-to-world`s them. Will take the given vertex and triangle strip them. Will use a if((numvertexes % 3) !=) apprach to checking for stray vertexes. Will have a flagging system for wireframe rendering or smooth rendering. Will develop a c4Load class Load system... Load objects. -Lights placed in a dynamic array. -Empty extra array for reflected lights setup. -Vertexes are kept non-global so that all the models dont get rendered altogether. -Figure out a methed where all vertexes are lit, but each model is rendered. Will develop a c4Text class for keyboard input/output. Will go over to the Win32 API here soon. Yuck ! GLUTs fine, but not flexible enough Won`t ever have a texture class in Bugle4D. Never seen a 3d picture maker. ;-) I could have the vertexes gradiented ito 3d texture, but would not serve purpose. Added c4Light::Switch() to turn a light on/off. Started c4Model. I need the triangle stripper ! Added template c4Point::Abs for flexiblity. ... Summary. Started c4Model. Added c4Light::Switch(). Kicked c4Polygon from the Things To Do list. Kicked enum c4Light::TYPE. Added template c4Point::Abs. --- Jan 7. Added cText:public c4PointC having: RenderChar() SetTProps() cText(char*). Right now using GLUT- hope to have texture charset implemented eventually. Lighting set aside: modeling set aside. I need to have some way to get feedback. The O, of I/O. Added to cEngine2API. typedef cEngine2API E2A; PopMatrix() PushMatrix() SendScale() SendTranslate() --- Jan 8. Worked on cText and outlined structure... Added PrintMe() Fixed the typedef error in cEngine2API --- Jan 9. Finished GLUT c4Text Added the structs to c4Model... HDR VERT LIGHT --- Jan 10. PrintMe() finished. SetT() added -- Jan 13. Finished the cSingle singleton class. I need to subject it to some intensive debugging before I really add it. However, it will be a crucial class in the engine. Time to w32 my test file...sigh... I have NeHeGL, in which I will encapsulate the commands... Fullscreen/windowed option ? Yes. That way I can other things at the same time. --- Jan 14. Great idea for cSingle. Utter failure for implemenatation. You can't reassign this. --- Jan 15. Compileable Win32 code. No keyboard function. No rendering, apperently. Have to get keyboard up an running, then the rendering. Then I can go and work on cSingle. --- Jan 20. Have been hacking Render() to work. Got it to work today. Figured out what was wrong + made Keybd function work. Made a FFILE class to quickly output a text file. WINSTATE class that holds all variables for application. Added a local camera class c4Point::QD. Changed c4Point::Perspect() to a real projection instead of majic number. Added key movements for 4rth D Threw out QD. Started class c4Camera : public c4Point Will delete class CAMERA, from the main file... I am dumb. I was wondering wy why triangle was always having verts of 0.0. I had not called my init() function. grr. ho well... Lets try this again... -- Jan 25. Added a cMath class so as to have a separate class for math ops. has Deg2Rad() Distance() IsSame() Sqr() -- Jan 27 Worked on Rotate, found a error, researched the algorithim to fix it. I think I need to design a pipeline for lights/shadows/camera etc. --- Jan 28 Fixed Rotate(); I had badly written it and missed 2 of the planes. Fixed Distance- i had a X1*X2 instead of a X1+X2 Commented Abs. Implemented cMath:: Deg2Rad IsSame Sqr Distance- underloaded version. Wrote a design spec for the bugle4d pipeline. -> Research threads/fibers, etc. It may be able to significantly speed up light processing. Worked on cModel; added the STL objects in definition code. Implementation of functions next. Read/Write/Modify, etc. --- Feb 2 Added c4Model:: AddVertex() DeleteVertex() FormTri() DeFormTri() LoadModel() UnLoadModel() Only did the interface, no implementation. --- Feb 3 Structure of model is.... Header, which contains. -Color modifier for the model. -number of lights -number of vertexes -number of tris Error check header, which contains... -b4d constant -filesize -checksum... List of vertexes List of lights List of triangles, which each contain 3 vertexes. Added struct c4Model::CHK, which contains the error data. Implemented first draft of the c4Model functions. Work on STL itereator/aray issues. --- Feb 8. Finsihed c4Point::Rotate, and reworeked the perspect() func. I think I need to have a function ? class ? struct ? that handles the pipeline. I have a pipeline laid out in a text file but I need to figure out for to best implement it. --- Feb 12. I`ve decided that while my shadow algorithim is ok, doing shadows in 4d would be a hair weird-looking. So I won`t implement a shadow system, at least not yet. I`m thinking I will have lights tho. I think I might have to rewrite my class hiarchy. You see, what has happened is: c4LightC has float x,y,z,q for position, and float r,g,b,a. This is great for dropping into cEngine2API. However, I`m going to have to work on it a bit to get a light system working. You see, I need a base color, and a modified color. Base color will stay the same, and the mod color will be set from it every frame. So unless inspiration hits me, I`m going to create a c4LightCL class, inherited from c4LightC. It willl probably contain float mr,mg,mb,ma; void SetModC(float r,b,g,a) Then, I will have all the values that pertain to light. Reflectivity(Specularity) and implementing that. I know there is a ton of stuff...I`ll grab my physics book and check it out. I`m feeling unlucky- I might go and recode my entire c4Point class family so that internally bugle4d uses certain data structures. See, what I`m finding that is needed is... a struct COLOR4{float r,g,b,a}; a struct POS4{float r,g,b,a}; These would be used in passing small amounts of data here and there, instead of using a c4PointC and separating the required component out. Also, I did not anticipate that 4D requires 6 angles for a successful rotation. So I have ben forced to add a local struct to c4Point to accomadate this. Again, I think that this nessesitates somewhat of a rewrite, unfortanatly. In reality, I suspect that a c4Camera class is called for. --- Feb 15. cMath inserted. Sqr() was giving a funky error that amounted to not being able to teplate it. So I :( macro`d it. Distance() will need to be overloaded according to type. IsSame() has epsilon of .0001 right now. I have Deg2Rad(), Everone's fave trig conversion func ! My conception of the pipeline is nearly done, I think. When I start the codeing for that, I`ll start the conceptualizing to incorporate the PODs. I have to have a c4Camera class to handle camera stuff. I will also need to get into the areana with the STL to get c4Model working like I want it to. Also, I need to come back to my cSingleton class. --- Feb 18. Learned a new term today ! cMath is technically a mixin. c4Model`s STL problems resolved, time to continue coding it. pipeline.txt is finished. Theres some trig function optimizations going on at gamedev.net`s Math and physics forum I`m going to use them in cMath. c4Model code fixed: AddVertex() DeFormTri() c4Model code updated: FormTri() c4Model function added: RenderMe. This will drop the model points down into the pipeline class Added structs COLOR4 and POS4. They are just structs, but with 1 func, Set(), just to make life easier. When only color or position is needed, use these. Added class c4PointCL. This adds properties for a light. Will fill in later. c4Camera polished a hair. Need to convert all my code to the POS4 and COLOR4 standard. 4drotation.txt worked on. Polished c4Point::Rotate() --- Feb 24. Fixed errors in c4Point::Rotate() Worked on lightthesis.txt and architecture.doc. Renamed c3Point::Set() to Set3() Renamed c4Point::Set() to Set4() Stubbed in funcs for c4Camera... Ortho() Perspect() WritePosition() World2Camera() Updated the FFILE class in my main.cpp file. Will probly promote it to a full c* class soon. Added the nescassary vars to c4PointCL brightness refectionvalue(specularity) opacity Note on classes: all non-public variables are declared protected in case of inheritance. Generally, variables that are expected to be updated frequently are declared public for speed. of executing, although this goes against OO principles. bugle4d is advertised as a OO engine, though. Here`s some code to illustrate why... class OO { float var; public: void SetV(float var){OO::var = var;} float GetV(){return var;} }; OO object; float variable = 0; object.SetV(variable); variable += object.GetV(); object.SetV(variable); //now for the other way... class aclass { public: float var; void SetV(float v){var = v;} }; aclass object; float variable = 100; object.SetV(variable); variable += object.var; Lets examine the two examples. In the first object, to use the data and set it in the object, we had to call a function, make a add, assign it, and call a function. Second object, we simply accessed it, made a add, and assigned it. It eliminated 2 function calls. Technically speaking, the second code is more coupled than the first. Note also, in the second example, if you wanted to change the variable name, it would break the code. But if you have say...8 varaibles... You really do not want to make 8 Get*()s, and 8 Set*()s. So you write a structure, and manipulate it with that... But you you want to cahnge a single value in the block. You can't without calling a Get(), accessing the value in the struct, and then calling a Set(). If your struct is OO`d, you have 2 more funcs to call. It is not vey fast. Very nice for modularity, and excellent if you plan to make alot of changes to your inner workings. However, for ease of coding ans speed of operating, I use public vars in oft-accessed places. POS4`s Set function has been fixed so that it could compile. Added cMAth::Rad2Deg() for radian to degree conversion. Created a struct WINSTATE to hold globals. I`m going to begin working on a document describing the modeller. --- March 3. Added cEngine2API:: SendBegin() SendEnd() SendRenderMode(int) coded them. --- March 10. Coded cEngine2API:: SendRotate(). Added cPipeline. Set c4Point::Distance(c4Point vert) to take a param o4 POS4 Set c4Camera to conform with the POS4 spec. Renamed c4Camera::PutCamera to ApplyCamera. --- March 17-28. Not a terrible lot. Now builds. Added POS3. Forgot to add to log. --- March 29. It builds and display the 3d axes. Time to get to work on the 4rth axis. Added some documentation to arcitecture.txt. Added local2world and inv funcs to c4model. I had forgotten to add them. Realized i needed a c3PointC class; then I realized I might as well make a cColor class. Added Perspect() for taking raw x,y,z,q vals. --- April 1. Added c4Camera::SetAngle() For setting the angles. --- April 21. It looks like keys() is one of the main time eaters. Thats O.K. Right now, I need tog et the code so that a 4 point of(a,b,c,0) perspected equals 3:(a,b,c)