Angelo
05-01-2007, 02:00 PM
Hello,
I learn completely newly Java and Java3D programming, because of this I have questions on it.
My current question is an automatic scaling.
I have partly solved it but it has not quite worked!
At first I explain the whole task to you briefly so that you can understand this small question.
The task is around calls of an editor side (.txt) in Java3D.
This list contains numbers of 3 components points (x, y, z).
e.g.: (1, 2, 3)
(2, 4, 6)
(3, 5, 7)
etc.
After calling the editor side these points shall be recorded as little balls (with minute radii).
I have completely taken care of it!
But the remained problem is:
Some Editor pages contain 3 components numbers, these sew from each other so are.
e.g.: (0.01, 0.02, 0.03)
(0.011, 0.021, 0.031)
(0.0111, 0.0211, 0.0311)
etc.
Only one roll because of this see the balls in the graphic on each other as. i.e:
We see only one ball.
I need an automatic scaling for it so that the programme supplies us with the correct drawing to every list
I must calculate min and Max at this automatic scaling first.
I have found that the right solution starts me with the following orders:
Code:
float minDistance = Float.MAX_VALUE;
for (int i=0; i<positionen.size(); i++)
{
for (int j=i+1; j<positionen.size(); j++)
{
Point3f p0 = positionen.get(i);
Point3f p1 = positionen.get(j);
minDistance = Math.min(minDistance, p0.distance(p1));
float faktor = minDistance / (2 * r);
}
}
But I still lack it the correct drawing a small step further, with that me
get can. Perhaps you have idea as I can make it further?
The whole program (Hello.java) is in the appendix (Hello.zip).
I have uploaded only the Java page of ball production here.
I have not uploaded the other Java page of calls of the editor side.
I think we do not need it for this problem.
But, if it is necessary, I can upload it later.
Please, somebody can help me at it?
And as I have already written I am a whole beginner in programming, primarily in Java3D.
Because we learn very little programming in my course of study "electrical engineering".
But I learn it as a voluntary traineeship.
I am immediately available for further explanations.
I am address within reach also under the following e-mail:
angelo.baro@gmx.net
Yours
Angelo
I learn completely newly Java and Java3D programming, because of this I have questions on it.
My current question is an automatic scaling.
I have partly solved it but it has not quite worked!
At first I explain the whole task to you briefly so that you can understand this small question.
The task is around calls of an editor side (.txt) in Java3D.
This list contains numbers of 3 components points (x, y, z).
e.g.: (1, 2, 3)
(2, 4, 6)
(3, 5, 7)
etc.
After calling the editor side these points shall be recorded as little balls (with minute radii).
I have completely taken care of it!
But the remained problem is:
Some Editor pages contain 3 components numbers, these sew from each other so are.
e.g.: (0.01, 0.02, 0.03)
(0.011, 0.021, 0.031)
(0.0111, 0.0211, 0.0311)
etc.
Only one roll because of this see the balls in the graphic on each other as. i.e:
We see only one ball.
I need an automatic scaling for it so that the programme supplies us with the correct drawing to every list
I must calculate min and Max at this automatic scaling first.
I have found that the right solution starts me with the following orders:
Code:
float minDistance = Float.MAX_VALUE;
for (int i=0; i<positionen.size(); i++)
{
for (int j=i+1; j<positionen.size(); j++)
{
Point3f p0 = positionen.get(i);
Point3f p1 = positionen.get(j);
minDistance = Math.min(minDistance, p0.distance(p1));
float faktor = minDistance / (2 * r);
}
}
But I still lack it the correct drawing a small step further, with that me
get can. Perhaps you have idea as I can make it further?
The whole program (Hello.java) is in the appendix (Hello.zip).
I have uploaded only the Java page of ball production here.
I have not uploaded the other Java page of calls of the editor side.
I think we do not need it for this problem.
But, if it is necessary, I can upload it later.
Please, somebody can help me at it?
And as I have already written I am a whole beginner in programming, primarily in Java3D.
Because we learn very little programming in my course of study "electrical engineering".
But I learn it as a voluntary traineeship.
I am immediately available for further explanations.
I am address within reach also under the following e-mail:
angelo.baro@gmx.net
Yours
Angelo