Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

12045 Posts in 1593 Topics- by 593 Members - Latest Member: zhang

19. June 2013, 05:56:46 am
  Show Posts
Pages: [1]
1  General Category / Support / Re: Scaling of Models on: 18. June 2012, 11:10:41 am
Thanks for the fast reply  Cheesy
It works perfectly now.
2  General Category / Support / Re: Scaling of Models on: 18. June 2012, 08:18:07 am
Hello again,
I got another problem with scaled models. When I use an ObjectRotationInputHandler to rotate my model the scaling factor is instantly reset. Is there a specific way to keep the scaling even while rotating the model around its center? The updateFromTransformable method for the rotationInputHandler doesn't seem to help in any way.
3  General Category / Support / Re: COLLADA Textures and faces trouble on: 22. May 2012, 08:29:56 am
I think your texture is wrong because you didn't define a new material for your appearance or otherweise it could stem from another lighting problem. You could try adding another light source like an ambient or directional light to your scene.
4  General Category / Support / Re: Scaling of Models on: 22. May 2012, 06:59:26 am
Ah thanks for the help. I can't believe I missed that ^^
5  General Category / Support / Scaling of Models on: 21. May 2012, 11:23:18 am
Hello everybody,
I've got a question concerning the scaling of 3D models. I know that you can scale the entire model with a transformation, but is there an easy way to scale the model in a specific dimension, like extending the length of the model while altering the height with a different parameter?

XamNiner
6  General Category / Support / Re: Problem with hard edges in OBJ files on: 11. April 2012, 10:51:09 am
Thanks for the help. I was able to remove those edges with the help averaged vertex normals. You can see the result in the screenshot below. The left model uses averaged vertex normals while the right model uses standard face normals I got from using calculateFaceNormals.
7  General Category / Support / Re: Problem with hard edges in OBJ files on: 03. April 2012, 11:00:52 am
Looks like every single triangle has a different color. Or maybe you have some strange material applied to it and lighting enabled.

I suggest to apply a texture to the foot and to reset the material (and apply a fixed one to enable lighting).

Thanks for the answer. I fixed my problem with the strangely shifting texture whenever  I rotated my model, because I just calculated the texture coordinates once for the appearance.
However I still seem to have a problem with the lighting of the model. In the picture below you can see the same model with the same material (just Material mat = new Material()). The left one has lighting disabled. The right one hast pretty hard edges between each face. Could this be because of faulty normal calculation? Or is there some other way to smooth those edges?
8  General Category / Support / Problem with hard edges in OBJ files on: 03. April 2012, 06:58:59 am
Hello Xith community,
I've got 3D footmodel as ".obj" file with around 20 000 vertices. When I try to display this model in my canvas I see the edges of all the faces that define my digital foot. Is there an easy way to smooth over these edges? I tried to apply a texture to that model, but it looks more like a strange prism and furthermore whenever I move the model the texture within a face shifts.
Any ideas of areas I could look into would be much appreciated.

XamNiner
9  General Category / Support / Re: Coloring geometry depending on distance on: 24. November 2011, 01:58:24 pm
Okay I found a solution for placing my models and calculating the distances. First I load every vertex of the first model (geoLeft) into a new float array. I want to color every vertex of that first model white so I save the vertex number + the white color inside a new color array. After that I load the coordinates of the second model into my float array and look for the shortest distance of my model point to every other point of the first model using
Code:
distance = coordsNewGeoLeft[vertCountLeft].distance(coordsNewGeoLeft[j]);
Finally I use my minimum distance for that point to compute a new color wich i save into my color array. I then use both the coordinate and the color array to build a new geometry which will be displayed in the scene.
My biggest problem however is that finding the minimum distance for every model point is extremely taxing and takes quite a large amount of time. It would be great if anybody got an idea how to speed up the time it takes to compute all those distances.  Wink

Code:
public Geometry grading(Model modelLeft, Model modelRight){
Geometry geoLeft = modelLeft.getShape(0).getGeometry();
Geometry geoRight = modelRight.getShape(0).getGeometry();
int vertCountLeft= geoLeft.getValidVertexCount();
int vertCountRight = geoRight.getValidVertexCount();
//Zielgeometrie
TriangleArray tri = new TriangleArray(vertCountLeft+vertCountRight);
//Koordinaten eines Punktes
float [] coordsGeo = new float[3];
//Punktkoordinaten Array
Point3f [] coordsNewGeoLeft = new Point3f [vertCountLeft+vertCountRight];
Point3f [] coordsNewGeoRight = new Point3f [vertCountRight];

//Farben für Modellpunkte
Colorf [] colArray = new Colorf[vertCountLeft+vertCountRight];
//Koordinaten von geo in coordsNewGeo laden
for (int i = 0; i < vertCountLeft; i++){
geoLeft.getCoordinate(i, coordsGeo);
coordsNewGeoLeft[i] = new Point3f( coordsGeo[0], coordsGeo[1], coordsGeo[2]);
//Modell von linkem Bein weiß transparent
colArray[i] = Colorf.WHITE_TRANSPARENT;
}
//Koordinaten von geoRight in  coordsNewGeo2 laden
for (int j = 0; j < vertCountRight; j++ ){
geoRight.getCoordinate(j, coordsGeo);
coordsNewGeoRight[j] = new Point3f (coordsGeo[0], coordsGeo[1], coordsGeo[2]);
}

float minDist = 100;
int countFest = vertCountLeft;

for (int i = 0; i < vertCountRight; i++,vertCountLeft++, minDist=100 ){
coordsNewGeoLeft[vertCountLeft] = coordsNewGeoRight[i];
for (int j = 0 ; j < countFest; j++){
/*
* Berechne kleinsten Abstand von jedem Punkt
* von Modell_Links zu aktuellem Punkt von Modell_Rechts
*/
float distance = coordsNewGeoLeft[vertCountLeft].distance(coordsNewGeoLeft[j]);
if (distance < minDist){
minDist = distance;
}
//Punkt von Modell_Rechts liegt direkt auf Modell_Links
if (minDist == 0){
colArray[i+countFest] = Colorf.RED;
}
//Modellpunkt entsprechend der größe von minDist einfärben
if (minDist > 0 && minDist != 100){
float colAtr = (1/20f) * minDist;
colArray[i+countFest] = new Colorf((1-colAtr), 0.0f , (colAtr));
}
}
}

//Koordinaten und Farben für neue Geometrie setzen
tri.setCoordinates(0, coordsNewGeoLeft);
tri.setColors(0, colArray);
tri.calculateFaceNormals();
return (tri);
}
10  General Category / Support / Coloring geometry depending on distance on: 14. November 2011, 11:52:39 am
Hello Xith Community. I'm pretty new to 3d graphical programming.
The testcases have been really helpful so far and I have learned a lot about displaying 3d models.
However I have run into a bit of a problem. It's kind of a special case of collision detection.

I have got 2 different 3d models I'm displaying right now. You can think of them as a hand and a glove. Now I'm moving the glove while the hand stays at the same position. For this I have adapted the collision test example.
My real problem is that I want to move the glove into position and look how good the glove is fitting my hand model. For this I want to paint my glove model with the corresponding colours (blue for glove model is bigger and red for glove is smaller or inside hand).
If anybody got a good idea how to evaluate the distance between the two models I would be really  grateful.
Pages: [1]
Theme orange-lt created by panic