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 - mxar

Pages: 1 2 3 [4] 5 6
46
Support / Re: Off screen rendering
« on: March 05, 2015, 10:47:24 am »
Thanks,

i think the best solution is doing the image manipulation using shaders.It bust be the faster solution.

Do you have any example of image manipulation using shaders, or do you know a tutorial?

I just want to get an idea about it.


Many thanks.




47
Support / Re: Off screen rendering
« on: March 05, 2015, 09:08:01 am »
Thanks for the answer.

The problem with the performance is when i call the FrameBuffer.readPixels[]. I think that is slow.

It would be faster if i call FrameBuffer.setRenderTarget with NPOT texture?.

The Bitmap manipulation (the pixels from readPixels()) is done in C++ using NDK ,in this way the manipulation is fast.

So I must find a fast way to read the pixels of the FrameBuffer.

Is there a way to offscreen render 3D models without the use of FrameBuffer?

Thanks in advance.


 

48
Support / Off screen rendering
« on: March 04, 2015, 09:38:02 pm »

Hi,

Im developing an Augmented reallity application in Android device.

One of the requirements of the project is to do off screen rendering of 3d models and then manipulate the result of rendering.

I used the FrameBuffer.readPixels() method to create a bitmap but this method is to slow for my needs.

Do you  suggest a better and faster way?

The projectCenter3D2D(Camera camera, FrameBuffer buffer, Object3D obj)  method returns the center of the object in screen-coordinates (2D) by transforming and projecting it from 3D objectspace into 2D screenspace.

How can i calculate the start position (x,y), width and height of a bounding rectangle of Object3D obj in 2D screenspace?

Thanks in advance.



49
Support / Re: [Tips] Android, augmented reality 3D with JPCT + Camera.
« on: January 22, 2015, 02:42:38 pm »
Hi,

I want to blit a captured image from camera to a FrameBuffer object in the onDraw() method.
On top of this image i want to display some 3d objects.It is an Augmented Reality application.

What is the best way to blit a captured image from camera to FrameBuffer?
The faster way?

Thanks in advance

50
Support / Re: Vertex colouring from last jPCT-AE version
« on: November 12, 2014, 10:15:23 am »
Ok

thanks

51
Support / Re: Vertex colouring from last jPCT-AE version
« on: November 12, 2014, 10:02:37 am »
Many thanks,

 this beta version is exactly the same with 1.29 version?

 The addition of new Object3D constructor is the only difference with version 1.29?

Thanks in advance

52
Support / Re: Vertex colouring from last jPCT-AE version
« on: November 11, 2014, 08:47:34 am »

Hi again,

there are cases vertex normal are pre-known. In such case, these normals describe the real-world object more accurately than the calculated ones.

Is there a way to give the jPCT-AE engine the known normal?

Can I use vertex or fragment shaders to use the pre-known vertex normals when building Object3D models with this constructor?


 Object3D object3D = Object3D(float[] coordinates, float[] uvs, int[] indices, int textureId)

Thanks in advance



53
Support / Re: Vertex colouring from last jPCT-AE version
« on: November 07, 2014, 09:34:03 pm »
OK, thanks.

54
Support / Re: Vertex colouring from last jPCT-AE version
« on: November 07, 2014, 10:51:08 am »
Hi again,

how can i apply vertex normals to  object3D when i call  this constructor ?

 Object3D object3D = Object3D(float[] coordinates, float[] uvs, int[] indices, int textureId)

Also ,do you know if .3ds model can have embedded  textute images?

I mean if it is possible  the texture images  not be  separated from the .3ds file.

Thanks in advance.





55
Support / Re: Vertex colouring from last jPCT-AE version
« on: October 30, 2014, 12:23:49 pm »
thanks

56
Support / Re: Vertex colouring from last jPCT-AE version
« on: October 29, 2014, 02:45:29 pm »
Hi again,

I wrote a code to apply vertex colors to loaded 3D model.

The part of the code that assignes vertex color is:

 int vertices = object3D.getMesh().getUniqueVertexCount();

        float[] data = new float[4*vertices];

        for(int i = 0; i < data.length; i++){
           
           data = 0.0f;
                   
              if(i%4 == 0)
                data = 0.0f; //red color
             
              if(i%4 == 1)
                 data = 0.0f; //green color
             
              if(i%4 == 2)
                  data = 1f; //blue color
             
              if(i%4 == 3)
                   data = 0.5f; //transparency
               
        }
         
        VertexAttributes  vattrs = new VertexAttributes("colorinfo",data,VertexAttributes.TYPE_FOUR_FLOATS);

        object3D.getMesh().addVertexAttributes(vattrs);
       
        GLSLShader  shader = new  GLSLShader( Loader.loadTextFile(mActivity.getResources().openRawResource(R.raw.vertexshader)),Loader.loadTextFile(mActivity.getResources().openRawResource(R.raw.fragmentshader)));

        object3D.setShader(shader);
       
       object3D.strip();
       object3D.build();
       world.addObject(object3D);

 The vertex shader is:

attribute vec4 colorinfo;
uniform mat4 modelViewProjectionMatrix;
attribute vec4 position;
varying vec4 vertexColor;


void main(void)
{
     vertexColor = colorinfo;
     gl_Position = modelViewProjectionMatrix * position;

}
 
And the fragment shader is:


varying vec4 vertexColor;


void main(void)
{
 gl_FragColor = vertexColor;
}


The problem is that i dont see any transparency. I see only a blue 3D model.

It looks like the code : 
             if(i%4 == 3)
                 data = 0.5f; //transparency

doesnt create any transparency.

How can i produce transparency with vertex colors?

Thanks in advance


57
Support / Re: Vertex colouring from last jPCT-AE version
« on: October 16, 2014, 01:39:24 pm »

OK,

Thank you.


58
Support / Re: Vertex colouring from last jPCT-AE version
« on: October 16, 2014, 10:41:44 am »


Ok

but I want to ask you if more types of Object3D models (like the supported .3ds,.obj ..) are planned to be supported in the near future by jPCT-ae.

Also non square texures with power of 2 sizes (like 512x256,128x64) are accepted and are safe ?

Thanks in advance


59
Support / Re: Vertex colouring from last jPCT-AE version
« on: October 15, 2014, 09:10:11 am »
Thanks for your answer,

I want to ask you if other type of Object3D models (like .3ds,.obj ..) are planned to be supported in the near future.

Also i found some 3D models with non square textures and having not power of 2 width and size.

I know that these kind of textures are not supported by jPCT-ae, but do you know any way to be used by jPCT-ae? (scaling?,some tranformation? ..).

Thanks in advance

60
Support / Re: Vertex colouring from last jPCT-AE version
« on: October 13, 2014, 09:59:00 pm »
Thanks for the answer.

I forgot to remove the unused vec4 theColor from fragment shader.

My current project is an Augmented Reality project.

I need to read the Augmented Object3D models from a data buffer not from a file.

This means that i dont know the format (.3ds, .obj,. md2 ..)  of the Object3D model stored in the data buffer.

The Object3D obj = Object3D(float[] coordinates, float[] uvs, int[] indices, int textureId)   method could be a good candidate in this case.

One part of the data buffer can store the float[] coordinates,
other parts the float[] uvs, int[] indices  and textureID.

But  some Object3D formats like .obj provide the material info in a separate .mtl file.

For example a .mtl file can have a content like this:
 
newmtl policecar.png
Ns 0
Kd 0.8 0.8 0.8
Ks 0.0 0.0 0.0
Ka 0.2 0.2 0.2
d 1
illum 2
map_Kd policecar.png


I think that the previews Object3D constructor doesn't provide this kind of info.

What do you think about this issue?


Thanks in advance








Pages: 1 2 3 [4] 5 6