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

Pages: [1]
Support / About Alien Runner's roads Object3D planes
« on: February 01, 2017, 10:49:25 pm »

The Alien Runner game uses a straight road which is based on Object3d planes.

In case  a developer needs to create a similar game with curved roads what the solution will be?

I'm trying to develop a method which creates a curved road.

The method will be something like this:

Object3D curvedPlane = createCurvedPlane(float innerRadius,float ouRadius,float angle,int quads)

This method is like the ExtendedPrimitives.createTube(float innerRadius, float outerRadius, float height, int quads)
but the height is equal to zero and the tube is not round but is drawn arount to an angle < 360 degrees.

Any idea to help me?

Thanks in Advance.
Modify message

Support / Coordinate conversion
« on: October 08, 2015, 11:27:58 am »


I have an issue with the jPCT-AE coordinate system.

In my application the Object3Ds are positioned from an application using the Opengl coordinate system.

How can i convert the opengl coordinate system to jPCT-AE coordinate system?

For example , when the third party application calls the Object3D.translate(float x, float y, float z) method then what steps i have to follow

to do the conversion?

Thanks in advance

Support / Integrating JPCT-AE with Vuforia - Rotation of modelViewMatrix
« on: September 23, 2015, 11:37:11 pm »


In JPCT-AE  - Vuforia integration procces, the modelview matrix created by Qualcomm's Vuforia engine is rotated 180 degrees around X axis before sending it to jPCT-AE, due to jPCT's coordinate system.

My question is if rotating the modelview matrix will have the result of displaying the 3D Objects upside down.

Also, is it possible JPCT-AE to have the same coordinate system as OpenGL? any special version of JPCT-AE perhaps? or configuration?

Thanks in Advance

Support / VertexAttributes.update () issue
« on: September 01, 2015, 09:34:35 am »

I want to render an OBJ object3d.
Part of the initialization code is:

Code: [Select]
GroupOfModels3D = Loader.loadOBJ(objStream, mtlStream, scale);
object3D = Object3D.mergeAll(GroupOfModels3D);;//<----- removing this line fixes the issue

GLSLShader blendingShader = new  GLSLShader( Loader.loadTextFile(res.openRawResource(R.raw.vertexshader)),Loader.loadTextFile(res.openRawResource(R.raw.fragmentshader)));

//assign vertex colors
 int  numberOfVertices = object3D.getMesh().getUniqueVertexCount();
  float[]     offScreenColorArray = new float[numberOfVertices * 4];

  for (int i = 0; i < offScreenColorArray.length; i++) {

  offScreenColorArray[i] = 0.0f;

  if (i > 0) {

  if (i % 4 == 0)
  offScreenColorArray[i] = 0; //red color

  if (i % 4 == 1)
  offScreenColorArray[i] = 0;//green color

  if (i % 4 == 2)
  offScreenColorArray[i] = 1;//blue color

  if (i % 4 == 3)
  offScreenColorArray[i] = 1; //transparency
  // 1-> opaque 0-> total
  // transparent
        vattrs = new VertexAttributes("colorinfo",offScreenColorArray,VertexAttributes.TYPE_FOUR_FLOATS);

At the beginning the object is rendered without using the blendingShader GLSLShader with no problem.

But later on run time i want to use the blendingShader  with a different array of color (red ) like this one:

Code: [Select]

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

        for(int i = 0; i < fixedColor.length; i++){
        fixedColor[i] = 0.0f;
              if(i%4 == 0)
              fixedColor[i] = 1;//red color
              if(i%4 == 1)
              fixedColor[i] = 0; //green color
              if(i%4 == 2)
              fixedColor[i] = 0; //blue color
              if(i%4 == 3)
              fixedColor[i] = 1;   //transparency

After i assign the new color i call the following lines:

Code: [Select]
      vattrs.update(fixedColor, 0);

But in this case the object3D is rendered with blue color (offScreenColorArray) instead of red color (fixedColor)

After a lot of hours i found out that if i remove the call of at the beginning, the object3d is rendered with red color  (fixedcolor array)

The used shaders are:

Code: [Select]
//------------------------------- vertexshader -------------------------

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

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


Code: [Select]
//-------------------------------- fragmentshader -------------------
varying vec4 theColor;
varying vec4 vertexColor;

void main(void)
 gl_FragColor = vertexColor;

What is the problem?

Thanks in Advance

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


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.

Support / A Racing game
« on: September 29, 2014, 12:02:23 pm »

Im thinking to start a racing game.

But i dont know the best way to build the road.

Should I use plane 3D objects ?
Should I load the parts of the road once at the begining of the game or dynamically?

Thanks in advance

Support / Vertex colouring from last jPCT-AE version
« on: September 29, 2014, 11:57:20 am »

vertex colouring is supported by the latest jPCT-AE version?

Thanks in advance.

Support / Loading a 3d object from memory (data buffer)
« on: September 16, 2014, 04:01:25 pm »

I'm working in a Augmented Reality project using jPCT-AE as the rendering engine.

I need to load dynamically on the camera surface a 3D Object from a data buffer (memory) not from  the raw or assets directory.

Is it possible?

Thanks in advance

Support / Object3D scale only one size
« on: July 07, 2014, 09:39:47 pm »
I have created an Object3D Box calling Primitives.getBox(float scale, float scaleHeight)  method.

 I need to scale only one size the width. The Object3D  Box must have width value not equal to length value.
 Is there any solution?

How can I scale only one size?

Pages: [1]