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.


Messages - ErDetEnAnd?

Pages: 1 ... 4 5 [6]
76
Support / Vertex optimization?
« on: May 18, 2008, 02:04:58 pm »
Hello.

I got a 3D object engine which writes models, and then they're passes into jPCT. When accessing an object's mesh data by a VertexController I see 33% less vertices than the original model has - regardless of model. What is going on?

Regards.

77
Support / Re: Relative scaling
« on: May 12, 2008, 10:27:01 am »
If object A and B have the same size but different world origin positions, and should be scaled by factor 0,5, the following would be the case in jPCT (if I got you right):



The gray objects is the scale result. Because the scaling is done on the object's world vertices, A' and B' dont have the same size anymore. Moving B to A, make the scaling and move B' back to it's original position solves the problem, but only while the two objects have the same size.

I find it strange that relative scaling hasn't been requested earlier, but one should not implement something thats not requested. Would you take this feature into considerations, or does it not easily fit into the engine?

78
Support / Re: Relative scaling
« on: May 11, 2008, 03:46:46 pm »
...which is cumulative. By relative scaling I mean that the new vertices are calculated using the objects vertices only. By absolute scaling you take the objects world vertices into account; scaling the object will move it according to world origin. Down scale an object e.g. 0.9x by absolute means, the object will resize but also move 10% closer to world origin. I want the object to resize while its origin vertex stay unchanged in the world.

79
Support / Re: Relative scaling
« on: May 11, 2008, 11:57:42 am »
So you're saying that the API has no relative scale feature, and this must be done by vertex management?

80
Support / Re: Relative scaling
« on: May 11, 2008, 11:25:48 am »
According to your doc, Object3D has two scaling methods, namely: scale and setScale which both takes a float argument. setScale(f) clearly points that its applies it changes in the world, while scale(f) seems only to apply on the object. Is this correct?

Quote
Why isn't a matrix needed to scale (transform) the object?
- Neither have I a transformation nor a rotation matrix assigned to the object, which scales anyway. Have I got something wrong; dont an object3d need a matrix to make any transformation/rotation calculations?

Absolute scaling with setScale(f) is sufficiently since I just could move the object back to gets original origin (and get the desired relative scaled object):

SimpleVector origin = o3d.getOrigin();
o3d.setScale(0.95f);
o3d.setTranslationMatrix(new Matrix());
o3d.setOrigin(origin);

81
Support / Relative scaling
« on: May 11, 2008, 10:22:55 am »
Hello.

Using Object3D.scale(float) to scale the object causing a tranformation to the object in world space. I though this method was related to object space? Why isn't a matrix needed to scale (transform) the object?

My other approach did have same result:
SimpleVector origin = o3d.getOrigin();
o3d.setScale(0.95f);
o3d.setTranslationMatrix(new Matrix());
o3d.translate(origin);

Truely something I've got wrong here. Please help.

82
Support / Re: Renderer feature
« on: May 08, 2008, 07:37:46 pm »
Thx for your answer. It led me to "polygon offset":

Quote
Polygon offset was an extension to OpenGL 1.0, and is now incorporated into OpenGL 1.1. It allows an application to define a depth offset, which can apply to filled primitives, and under OpenGL 1.1, it can be separately enabled or disabled depending on whether the primitives are rendered in fill, line, or point mode. Thus, an application can render coplanar primitives by first rendering one primitive, then by applying an offset and rendering the second primitive.

Whole article:
http://www.opengl.org/resources/faq/technical/polygonoffset.htm

Is this feature supported by jPCT in any software renderer? - I guess its available using its OpenGL renderer?

83
Support / Renderer feature
« on: May 08, 2008, 06:55:19 pm »
Hello.

I need to solve a problem where two objects have (partial) identical plane coordinates. Imagine two boxes with same size and position but different textures. This causes flicker once transforming the objects together. Before I go to dramatic changes I'd like to know if jPCT is capable of prior the rendering of one object, by defining which object to appear.

Regards
Ducky

84
Support / Re: Assign text to objects
« on: March 09, 2008, 01:04:19 pm »
AHA!

Thats the answer, rescaling does the trick.

Skide godt!

85
Support / Assign text to objects
« on: March 09, 2008, 11:14:58 am »
Hello guys.

I want to assign text to objects. Putting the text at the objects transformed center is the goal. In my solution I have one "origin object" which has several childs attached to it, and the camera towards it.

Now, placing the text should be something like this (just after the framebuffer has been flushed):

Code: [Select]
SimpleVector origin = Interact2D.project3D2D(camera, buffer, originObject.getCenter());
int length = gFrame.getFontMetrics().stringWidth(originObject.getName());
length /= 2;
gFrame.drawString(originObject.getName(), (int)origin.x-length, (int)origin.y);

... but it's not. The origin object's name appear at coordinate (frame_width; frame_height), leaving 1/4 of the text visible at the buttom to the right. First question is why it that?

Rewriting last line to this:

Code: [Select]
gFrame.drawString(originObject.getName(), (int)origin.x-length-(getWidth()/2), (int)origin.y-(getHeight()/2));
...solves the wrong position. The text appears right in the center of the object.

Now for the child objects:

Code: [Select]
for (Object3D o3d: childObjects) {
    SimpleVector v = o3d.getTransformedCenter();
    v = Interact2D.project3D2D(camera, buffer, v);

    length = gFrame.getFontMetrics().stringWidth(o3d.getName());
    length /= 2;
    gFrame.drawString(o3d.getName(), (int)v.x-length-(getWidth()/2), (int)v.y-(getHeight()/2));
    // Still should be: gFrame.drawString(o3d.getName(), (int)v.x-length, (int)v.y);
}

The transformation is correct, but the positioning have some kind of offset, like the distance from object's transformed center and it's assigned text is like the distance from origin and transformed object * 2.



What am I doing wrong?

86
Support / Re: Contrast due to scaling
« on: March 09, 2008, 10:48:43 am »
No fogging is enabled.

It seems to be the brightness of lights, and they are very very hard to control to give a good light so shapes looks realistic instead of a single color.

87
Support / Contrast due to scaling
« on: March 05, 2008, 09:58:45 am »
Hello all!

First of all I'd like to appreciate the work that have made so intuitive 3D handling feasible in Java.

About my question:
Once an object is created in the world, a solid gray texture has been assigned to it and lights have been set up, the object shows to the camera like one could expect. I'm scaling the object to make a zoom effect when using the mouse. What I find strange is that the object appears brighter the closer the camera get (almost white), and darker as the distance grows (almost black).

I've tried to move the lights far away but no improvement.

Could someone explain what is happening, and how to avoid it?

Regards

Pages: 1 ... 4 5 [6]