Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Vehicle Activated Signs - VAS
09-26-2008, 06:00 AM,
#11
 
Hello.

I am doing the demo and I have found that I needed
a "scale" factor in the SCENETRANSFORM class.

I have done this following patch:

Code:
diff -r 711d51ab2958 -r 552b4b4e8efa include/scenegraph.h
--- a/include/scenegraph.h      Wed Sep 24 09:12:51 2008 +0200
+++ b/include/scenegraph.h      Fri Sep 26 10:11:48 2008 +0200
@@ -153,12 +153,16 @@ private:
private:
        QUATERNION rotation;
        VERTEX translation;
+  float scale;

public:
+  SCENETRANSFORM() : scale(1.0f){};
        const QUATERNION & GetRotation() const {return rotation;}
        const VERTEX & GetTranslation() const {return translation;}
+  float GetScale(void) const { return scale;}
        void SetRotation(const QUATERNION & rot) {rotation = rot;}
        void SetTranslation(const VERTEX & trans) {translation = trans;}
+  void SetScale(float aScale) { scale = aScale;}
        bool IsIdentityTransform() const {return (rotation.IsIdentity() && translation.IsZero());}
        void Clear() {rotation.LoadMultIdent();translation.zero();}
};
diff -r 711d51ab2958 -r 552b4b4e8efa src/scenegraph.cpp
--- a/src/scenegraph.cpp        Wed Sep 24 09:12:51 2008 +0200
+++ b/src/scenegraph.cpp        Fri Sep 26 10:11:48 2008 +0200
@@ -320,6 +320,7 @@ void SCENENODE::GetCollapsedDrawList(lis
                //transmat.Translate(transform.GetTranslation());
                MATRIX4 rotmat;
                rotmat.Set(transform.GetRotation());
+               rotmat.Scale(transform.GetScale());
                rotmat.Translate(transform.GetTranslation());

                //this_transform = (rotmat.Multiply(transmat)).Multiply(curmat);
@@ -378,6 +379,7 @@ MATRIX4 SCENENODE::CollapseTransform() c
        {
                MATRIX4 rotmat;
                rotmat.Set((*i)->transform.GetRotation());
+               rotmat.Scale((*i)->transform.GetScale());
                rotmat.Translate((*i)->transform.GetTranslation());
                outmat = rotmat.Multiply(outmat);
        }

In this mode I can have only one joe object and I put
in the list the position, rotation and scale.

Just for the demo purpouses it is good.

Now I am collecting some beautiful textures... Smile
Reply


Messages In This Thread
Vehicle Activated Signs - VAS - by lino - 09-22-2008, 04:22 PM
[No subject] - by lino - 09-23-2008, 10:31 AM
[No subject] - by joevenzon_phpbb2_import3 - 09-23-2008, 10:36 PM
[No subject] - by lino - 09-24-2008, 09:44 AM
[No subject] - by joevenzon_phpbb2_import3 - 09-24-2008, 11:45 AM
[No subject] - by lino - 09-25-2008, 04:12 AM
[No subject] - by joevenzon_phpbb2_import3 - 09-25-2008, 10:19 AM
[No subject] - by lino - 09-25-2008, 10:46 AM
[No subject] - by lino - 09-25-2008, 01:51 PM
[No subject] - by lino - 09-26-2008, 06:00 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)