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.


Topics - ErDetEnAnd?

Pages: 1 [2]
16
Support / Get world position of untransformed object.
« on: December 10, 2008, 11:28:34 am »
Hi.

I've imported an object3d an need to translate it to world origo, but how to I get the objects world position when it hasn't been transformed?

17
Support / Translation on rotation
« on: November 27, 2008, 04:57:52 pm »
Put sense into this.

// I read a 3DS file that contains 2 object3ds.
Object3D[] obj = Loader.read(...)

// I have translation and rotation offsets for both object3ds.
obj[0].translate(translation_offset1);
obj[1].translate(translation_offset2);
obj[0].translateMesh();
obj[1].translateMesh();

obj[0].rotateX(rotation_offset1);
obj[1].rotateX(rotation_offset2);
obj[0].rotateMesh();
obj[1].rotateMesh();

Object3D o3d = o3ds[0];
            for (Object3D o: o3ds)
                if (o!=o3d)
                    o3d = Object3D.mergeObjects(o3d, o);

o3d is added to the world etc.

Why is mesh translation/rotation necessary when merging objects?
Without rotation the translation part works, but then I rotate and the obj moves!? Why does it move on rotation?

18
Support / GLCanvasRender performance and mouse events
« on: September 30, 2008, 09:17:01 pm »
Hello.

The following code gives many fps when using the GLCanvasRender:

Code: [Select]
while (true) {
            matrix.rotateY(0.1f);
            renderScene();
}

But when the rotating is done by using the mouse (drag event), the fps I get is somewhat opposit the mouse speed. To avoid unnecessary rendering drag events are ignored if mouse point equals previous mouse point. Test shows that the mouse speed does not affect the number of events. So why the low fps when using the mouse? Any ideas?

19
Support / Access canvas in GLCanvasRender from LWJGL
« on: September 28, 2008, 10:06:25 pm »
Hello!

I need to paint on the canvas after it has been painted in lwjgl (when the canvas has been displayed and repainted from jpct). Does anyone have any ideas?

 - Lwjgl suggests that one overrides the paint/paintGL method, but since the JPCT render gives the canvas this approach is not possible.

Thanks in advance.

20
Support / Transform regardsless of earlier transformation or rotation
« on: September 04, 2008, 01:21:30 pm »
Hi.

I have 3 objects. 1 parent and 2 children. The parent should always be in the middle of the screen, and when clicking on a child, the clicked child center should transform to the parent center. The children share the same matrices, thus the children are transformed by same vector.

My approach only works when the objects are neither transformed nor rotated.
I calculate the subvector between the parent and the clicked child, then translates their matrix, but the result is dependant on ealier transformation and rotation. I dont think I have the correct understance of the two.

Where am I wrong?

21
Support / Software rendering and swing components
« on: August 28, 2008, 10:26:26 am »
Hi.

By using the software render, how is it possible to add swing components on the same pane you're drawing the world on. The swing components should be on top of the rendered scene. Is there a right way to do this?

Regards.

22
Support / Reprojection in world space down camera axis
« on: May 21, 2008, 06:24:38 pm »
Hello.

A click on the awt frame gives me a screen coordinate. How do I reproject that coordinate into world space simplevector, and move it down the camera z-axis?

Tried long time now multiply the reprojected vector with a world matrix with no luck.

Thank you.

23
Support / Mouse selection using vertex information
« on: May 19, 2008, 06:04:56 pm »
Hello.

How do I access the transformed vertex information? I understand a IVertexController implementation operates in object space, but could it somehow work in the world? The PolygonManager delivers the transformed vertex, but it assumes that one is operating on polygons. I wouldn't expect the PolygonManager is the obviously choise for this kind of job - the current approach would then give 3x CPU overhead (for triangles).

By custom selection the transformed mesh should be directly accessible, but I can't figure out how...

Thanks in advance!

24
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.

25
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.

26
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

27
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?

28
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 [2]