Discussion:
Beispiel 3
(zu alt für eine Antwort)
Mikael
2003-11-10 20:25:40 UTC
Permalink
Hi!

Why do I get the following error messages:


'.class' expected
trans.setTranslate(double x, double y, double z);
*
')' expected
trans.setTranslate(double x, double y, double z);
*

The method looks like this:

public void translate (double x, double y, double z, byte
transformationMode)
{

CG1Matrix4x4 trans = new CG1Matrix4x4();
trans.setTranslate (double x, double y, double z);
transformationMode=0;
switch (transformationMode){
case 0: modelMatrixPoint.multLeft(trans); break;
case 1: modelMatrixPoint.multRight(trans);break;
case 2: modelMatrixPoint.multLeft(trans); break;
}

Danke!
Mikael
2003-11-10 20:31:41 UTC
Permalink
Ok never mind. I know what I did wrong.....
Post by Mikael
Hi!
'.class' expected
trans.setTranslate(double x, double y, double z);
*
')' expected
trans.setTranslate(double x, double y, double z);
*
public void translate (double x, double y, double z, byte
transformationMode)
{
CG1Matrix4x4 trans = new CG1Matrix4x4();
trans.setTranslate (double x, double y, double z);
transformationMode=0;
switch (transformationMode){
case 0: modelMatrixPoint.multLeft(trans); break;
case 1: modelMatrixPoint.multRight(trans);break;
case 2: modelMatrixPoint.multLeft(trans); break;
}
Danke!
Andy
2003-11-11 17:34:48 UTC
Permalink
Hi Mikael!

I've got a question:
Why is it necessary to create another new CG1Matrix4x4 object "trans"
although we already have one ("modelMatrixPoint")?
Can't we just overwrite modelMatrixPoint?
btw: within the method "multLeft" I made a copy of the "m"-array so that I
won't reference altered values while multiplying the matrices.

Andreas
Post by Mikael
...
public void translate (double x, double y, double z, byte
transformationMode)
{
CG1Matrix4x4 trans = new CG1Matrix4x4();
trans.setTranslate (double x, double y, double z);
transformationMode=0;
switch (transformationMode){
case 0: modelMatrixPoint.multLeft(trans); break;
case 1: modelMatrixPoint.multRight(trans);break;
case 2: modelMatrixPoint.multLeft(trans); break;
}
Andy
2003-11-11 17:46:53 UTC
Permalink
It's me again.

What I just wrote wouldn't make any sense :)
I would multiply the matrix which I set before with itself - I thought that
it would make a copy ...
So I just answered my own question ...


Thx for inspiring me

Andreas
Post by Andy
Hi Mikael!
Why is it necessary to create another new CG1Matrix4x4 object "trans"
although we already have one ("modelMatrixPoint")?
Can't we just overwrite modelMatrixPoint?
btw: within the method "multLeft" I made a copy of the "m"-array so that I
won't reference altered values while multiplying the matrices.
Andreas
Post by Mikael
...
public void translate (double x, double y, double z, byte
transformationMode)
{
CG1Matrix4x4 trans = new CG1Matrix4x4();
trans.setTranslate (double x, double y, double z);
transformationMode=0;
switch (transformationMode){
case 0: modelMatrixPoint.multLeft(trans); break;
case 1: modelMatrixPoint.multRight(trans);break;
case 2: modelMatrixPoint.multLeft(trans); break;
}
Loading...