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...