Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Alexey

#31
Bones / Re: blender2ogre -> BufferOverflowException
June 15, 2011, 02:46:37 PM
Thank you for reply! I convert xml to .mesh by OgreXmlConverter (from tools), it show  "WARNING: vertex count (9900) is not as claimed (1788)", i don't know why, but now i change <sharedgeometry vertexcount="9900"> in XML and try run :

Exception in thread "main" java.lang.IllegalArgumentException: No controller found in OgreEntityNode. Means there is no skeleton or pose animation!
at raft.jpct.bones.BonesImporter.importOgre(BonesImporter.java:132)
at bones.samples.OgreSample.createAnimatedGroup(OgreSample.java:42)
at bones.samples.AbstractSkinSample.initialize(AbstractSkinSample.java:79)
at bones.samples.OgreSample.initialize(OgreSample.java:58)
at bones.samples.AbstractSample.loop(AbstractSample.java:86)
at bones.samples.OgreSample.main(OgreSample.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
#32
Bones / blender2ogre -> BufferOverflowException
June 15, 2011, 08:10:41 AM

Exception in thread "main" java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Buffer.java:495)
at java.nio.DirectFloatBufferU.put(DirectFloatBufferU.java:250)
at com.jmex.model.ogrexml.OgreLoader.loadVertexBuffer(OgreLoader.java:381)
at com.jmex.model.ogrexml.OgreLoader.loadMesh(OgreLoader.java:625)
at com.jmex.model.ogrexml.OgreLoader.loadModel(OgreLoader.java:225)
at com.jmex.model.ogrexml.OgreLoader.loadModel(OgreLoader.java:177)
at bones.samples.OgreSample.createAnimatedGroup(OgreSample.java:38)
at bones.samples.AbstractSkinSample.initialize(AbstractSkinSample.java:79)
at bones.samples.OgreSample.initialize(OgreSample.java:57)
at bones.samples.AbstractSample.loop(AbstractSample.java:86)
at bones.samples.OgreSample.main(OgreSample.java:74)
#33
Hi!
I tried export mesh + animation from blender (2.57). When i exporting collada and load dae in bones sample, only one animation present. I make 2 animation actions in blender but only one loads. I should make animation actions in some specific way in blender? And another question - i setup http://code.google.com/p/blender2ogre/ blender-ogre exporter and try load exported someMesh.mesh.xml, but then java.nio.BufferOverflowException throw & the same when try convert by .bat . Result .mesh.xml file, i suspicious, is too big 3.2 mb (.dae only ~600kb).  I need another exporter or ?
#34
Support / Re: Client-Server-Applet-HTML
April 30, 2011, 01:36:58 AM
Сonsole show security troubles, then the problem is not in security. Do you work with applets before? What kind of connection do you use? Client-Server-Applet-HTML is not a real scheme,  what should make an applet and what data exchange will be between applet-server?
#35
I am a newbie in 3d & graphics, maybe i don't  understand some details and thinking differently, but i've been using intuitive methods by name.
#36
I see that the setRotationMatrix set translation too.
I solve my issue by this class:


public class Object3dEx extends Object3D {
    private static final short childMax = 10;
    private String group;
    private int childCnt = 0;
    private Object3dEx[] children = new Object3dEx[childMax];

    //Rotation around vector cache
    private Matrix cacheRotAxisMat;
    private float cacheRotAng;
    private float cacheRotAngCos;
    private float cacheRotAngSin;
    private SimpleVector cacheRotVec;


    public Object3dEx(Object3D obj) {
        super(obj, true);
    }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public void addChildEx(Object3dEx o) {
        if (o != null && childCnt < childMax) {
            children[childCnt] = o;
            ++childCnt;
        }
    }

    public void removeChildEx(Object3dEx o) {
        if (o != null) {
            for (int i = 0; i < children.length; i++) {
                if (o.equals(children[i])) {
                    children[i] = null;
                    --childCnt;
                }
            }
        }
    }

    @Override
    public void translate(float x, float y, float z) {
        translate(new SimpleVector(x, y, z));
    }

    @Override
    public void translate(SimpleVector trans) {
        super.translate(trans);
        if (children != null && children.length > 0) {
            for (Object3dEx ch : children) {
                if (ch != null) {
                    ch.translate(trans);
                }
            }
        }
    }

    @Override
    public void rotateX(float w) {
        super.rotateX(w);
        rotateChildren(w, 0, 0);
    }

    @Override
    public void rotateY(float w) {
        super.rotateY(w);
        rotateChildren(0, w, 0);
    }

    @Override
    public void rotateZ(float w) {
        super.rotateZ(w);
        rotateChildren(0, 0, w);
    }

    @Override
    public void setScale(float absScale) {
        super.setScale(absScale);
        if (children != null && children.length > 0) {
            for (Object3dEx ch : children) {
                if (ch != null) {
                    ch.setScale(absScale);
                }
            }
        }
    }

    @Override
    public void scale(float scale) {
        super.scale(scale);
        if (children != null && children.length > 0) {
            for (Object3dEx ch : children) {
                if (ch != null) {
                    ch.scale(scale);
                }
            }
        }
    }

    public void removeChildAll() {
        children = new Object3dEx[childMax];
        childCnt = 0;
    }

    public void rotateChildren(float x, float y, float z) {
        if (children != null && children.length > 0) {
            for (Object3dEx ch : children) {
                if (ch != null) {
                    SimpleVector parentPosition = this.getTransformedCenter();
                    ch.rotateAroundVectorX(parentPosition, x);
                    ch.rotateAroundVectorY(parentPosition, y);
                    ch.rotateAroundVectorZ(parentPosition, z);
                }
            }
        }
    }

    public void rotateAroundVectorX(SimpleVector vector, float angle) {
        if (angle == 0) return;
        vector.x = 1;
        rotateAroundVector(vector, angle);
    }

    public void rotateAroundVectorY(SimpleVector vector, float angle) {
        if (angle == 0) return;
        vector.y = 1;
        rotateAroundVector(vector, angle);
    }

    public void rotateAroundVectorZ(SimpleVector vector, float angle) {
        if (angle == 0) return;
        vector.z = 1;
        rotateAroundVector(vector, angle);
    }

    public void rotateAroundVector(SimpleVector vector, float angle) {
        if (angle == 0) return;

        float c, s;
        Matrix m;
        boolean cachedAngle = false;

        if (cacheRotAng == angle) {
            c = cacheRotAngCos;
            s = cacheRotAngSin;
            cachedAngle = true;
        } else {
            cacheRotAng = angle;
            c = FloatMath.cos(angle);
            cacheRotAngCos = c;
            s = FloatMath.sin(angle);
            cacheRotAngSin = s;
        }

        if (cacheRotVec != null && cacheRotVec.equals(vector) && cachedAngle && cacheRotAxisMat != null) {
            m = cacheRotAxisMat;
        } else {
            cacheRotVec = vector;
            m = new Matrix();

            float a11 = c + (1 - c) * vector.x * vector.x;
            float a12 = (1 - c) * vector.x * vector.y - s * vector.z;
            float a13 = (1 - c) * vector.z * vector.x + s * vector.y;
            m.setRow(0, a11, a12, a13, 0);

            float a21 = (1 - c) * vector.x * vector.y + s * vector.z;
            float a22 = c + (1 - c) * vector.y * vector.y;
            float a23 = (1 - c) * vector.z * vector.y - s * vector.x;
            m.setRow(1, a21, a22, a23, 0);

            float a31 = (1 - c) * vector.z * vector.x - s * vector.y;
            float a32 = (1 - c) * vector.z * vector.y + s * vector.x;
            float a33 = c + (1 - c) * vector.z * vector.z;
            m.setRow(2, a31, a32, a33, 0);

            m.setRow(3, 0, 0, 0, 1);

            cacheRotAxisMat = m;
        }

        Matrix currentTransformMatrix = getWorldTransformation();
        currentTransformMatrix.matMul(m);
        clearTranslation();
        getRotationMatrix().setRow(3, 0, 0, 0, 1);
        setRotationMatrix(currentTransformMatrix);
    }
}

#37
Thanks for reply, in my case pivot move to "parent", then rotate after that i mast return pivot to 0,0,0 but if i return it after call rotations methods pivot changes don't apply and rendering rotation around 0,0,0 ;
I write rotation function, but some strange happens with translation -

Looks like translation vector multiply by 2 after setting rotation matrix: mast be -12.869117 -10.0 -15.309665 1.0 , but - -27.011253 -20.0 -29.451801 1.0
thats code & log of it:


                System.out.println("world matrix = " + getWorldTransformation());
System.out.println("operation matrix = " + m);

Matrix currentTransformMAtrix = getWorldTransformation();
currentTransformMAtrix.matMul(m);
Matrix translateMatrix = new Matrix();
translateMatrix.setRow(3, currentTransformMAtrix.get(3, 0), currentTransformMAtrix.get(3,1), currentTransformMAtrix.get(3, 2), 1);
System.out.println("Result mul matrix = " + currentTransformMAtrix);

setRotationMatrix(currentTransformMAtrix);
System.out.println("world matrix after rotation = " + getWorldTransformation());
setTranslationMatrix(translateMatrix);
System.out.println("world matrix after translation = " + getWorldTransformation());



04-29 08:18:28.314: INFO/System.out(216): world matrix = (
04-29 08:18:28.314: INFO/System.out(216): -3.214496E-8 1.04 3.214496E-8 0.0
04-29 08:18:28.314: INFO/System.out(216): -0.735391 -4.5459842E-8 0.735391 0.0
04-29 08:18:28.314: INFO/System.out(216): 0.735391 0.0 0.735391 0.0
04-29 08:18:28.314: INFO/System.out(216): -14.142136 -10.0 -14.142136 1.0
04-29 08:18:28.314: INFO/System.out(216): )
04-29 08:18:28.314: INFO/System.out(216): operation matrix = (
04-29 08:18:28.324: INFO/System.out(216): 0.99627036 0.0 0.08628637 0.0
04-29 08:18:28.324: INFO/System.out(216): 0.0 1.0 0.0 0.0
04-29 08:18:28.324: INFO/System.out(216): -0.08628637 0.0 0.99627036 0.0
04-29 08:18:28.324: INFO/System.out(216): 0.0 0.0 0.0 1.0
04-29 08:18:28.324: INFO/System.out(216): )
04-29 08:18:28.324: INFO/System.out(216): Result mul matrix = (
04-29 08:18:28.324: INFO/System.out(216): -3.479874E-8 1.04 2.92514E-8 0.0
04-29 08:18:28.324: INFO/System.out(216): -0.79610246 -4.5459842E-8 0.66919404 0.0
04-29 08:18:28.335: INFO/System.out(216): 0.66919404 0.0 0.79610246 0.0
04-29 08:18:28.335: INFO/System.out(216): -12.869117 -10.0 -15.309665 1.0
04-29 08:18:28.335: INFO/System.out(216): )
04-29 08:18:28.335: INFO/System.out(216): world matrix after rotation = (
04-29 08:18:28.335: INFO/System.out(216): -3.479874E-8 1.04 2.92514E-8 0.0
04-29 08:18:28.335: INFO/System.out(216): -0.79610246 -4.5459842E-8 0.66919404 0.0
04-29 08:18:28.335: INFO/System.out(216): 0.66919404 0.0 0.79610246 0.0
04-29 08:18:28.344: INFO/System.out(216): -27.011253 -20.0 -29.451801 1.0
04-29 08:18:28.344: INFO/System.out(216): )
04-29 08:18:28.344: INFO/System.out(216): world matrix after translation = (
04-29 08:18:28.344: INFO/System.out(216): -3.479874E-8 1.04 2.92514E-8 0.0
04-29 08:18:28.354: INFO/System.out(216): -0.79610246 -4.5459842E-8 0.66919404 0.0
04-29 08:18:28.354: INFO/System.out(216): 0.66919404 0.0 0.79610246 0.0
04-29 08:18:28.354: INFO/System.out(216): -25.738234 -20.0 -30.61933 1.0
04-29 08:18:28.354: INFO/System.out(216): )


p.s. why method to set transformation matrix is not present?
#38
Support / Re: Client-Server-Applet-HTML
April 29, 2011, 12:15:06 AM
java console show any exception?
#39
Unfortunately solution from that thread not approached. In my case, for example -  5 objects

  (obj1)(---obj2---)(obj3)(---obj4---)(obj5)   on some axis

obj3 set parent to others & rotate, than remove all child relation, after that obj1 or another can be parent for same group of objects in another axis etc.
And dummy object solution i think not good for this situation, because possible many relation changes sequences.

For overriding relations i need move child's rotation pivot to parent rotation pivot, i tried use child.rotateAxis(parent.get*Axis(), angle) , but this some reason did not work, maybe need convert parent axis vector?

p.s. when in collision listener i try set texture to collision polygon (texture not set before) happens arrayIndexOutOfBounds, but polygon ID  < maxPolyIds.
p.p.s sorry for my english.


#40
How does the process of rotation and translation works for child objects?
Can you tell, please, if i'm going to override child-parent relation, how better implement child rotation near parent pivot?
#41
If after parent object rotation remove child, child object reset translation/rotation which were applied by parent relation.
It is a bug? How i can leave child in current place after removing parent relation?
#42
Support / Re: 3D demos
March 01, 2011, 09:11:46 AM
if push 1 on ~1 second ?  ;) try as "drum roll" touch screen
#43
Support / Re: Tutorials or some help
February 28, 2011, 05:34:27 PM
Ok, thanks. I already tried jpct collision, but need some physics. Ill try it
#44
Support / Re: Tutorials or some help
February 28, 2011, 02:41:02 PM
AE supports jBullet? Or other physics engines?
#45
Support / Re: 3D demos
February 28, 2011, 01:57:59 PM
I try this 2 demos..., on bowling boxes, when push ball on the bottom, ball often passes through box. When balls count > ~15 its really lag (HTC DHD)