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

Pages: 1 [2] 3
16
Support / Re: Polylines
« on: October 28, 2012, 09:59:44 pm »
Hi Egon,

No. I'm not trying to create the polygons triangle boundary polylines but rather contour lines. What if I use the transformed vertex height before normalising? Convert the value to an int, then mod 10 = 0?

OR is it possible to have a texture with transparent pixels? Then I could use the transparent pixel for no display and the color pixel for the contour line?

OR any other suggestions?

17
Support / Polylines
« on: October 23, 2012, 12:29:07 am »
Hi All,

I'm thinking I may be able to derive polylines from my models? In the snippet below I am assigning multi textures via the polygon manager. Do you think it may be possible to use modulus to create the polylines at equal intervals? Something like : if (vertextHeight.z % 10 = 0), polylineVertexs.append(vertexHeight.x, vertextHeight.y, vertexHeight.z), new Polyline(polylineVertexs) ??

Code: [Select]
for (Object3D obj : models) {
PolygonManager objPolyManager = obj.getPolygonManager();

// for each polygon set texture according to normalised vertex elevations
for (int i = 0; i < objPolyManager.getMaxPolygonID(); i++) {
float u0 = 0, u1 = 0, u2 = 0;

for (int j = 0; j < 3; j++) {
SimpleVector vertexHeight = objPolyManager.getTransformedVertex(i, j);
float normalisedHeight = (vertexHeight.z - MIN_Z)/(MAX_Z - MIN_Z);

if (j == 0) {
u0 = normalisedHeight;
}
else if (j == 1) {
u1 = normalisedHeight;
}
else if (j == 2) {
u2 = normalisedHeight;
}
}

TextureInfo ti = new TextureInfo(tm.getTextureID("esri_color_scale"), u0, u0, u1, u1, u2, u2);
objPolyManager.setPolygonTexture(i, ti);
}
world.addObject(obj);
}

18
Support / Re: Multiple textures on a terrain
« on: October 08, 2012, 03:26:12 am »
Thanks Egon. Perfect!

I now have a scaled color applied to my terrain.  :D

Now I need to fix my onPause and onResume from my master activity... :P

[attachment deleted by admin]

19
Support / Re: Multiple textures on a terrain
« on: October 05, 2012, 03:43:42 am »
Hi Egon,

I have normalized the height values (correctly? snippet below) to values between 0 - 1. How do I set the texture using these values? I understand the u/v as texture coords but how do I assign values from the single texture?

Code: [Select]
for (Object3D obj : models) {
PolygonManager objPolyManager = obj.getPolygonManager();
Logger.log("Max poly ID " + obj.getName() + ": " + objPolyManager.getMaxPolygonID());

// for each polygon set texture according to vertex elevation
for (int i = 0; i < objPolyManager.getMaxPolygonID(); i++) {
Logger.log("Poly num: " + i);

for (int j = 0; j < 3; j++) {
SimpleVector height = objPolyManager.getTransformedVertex(i, j);
float tempMin = (float) 2.7523;
float tempMax = (float) 555.413025;
float normHeight = (height.z - tempMin)/(tempMax - tempMin);

Logger.log("Normalised vertex height #: " + j + " - " + normHeight);
}

Thank you for your help with this task. I will endeavour to repay you some way, some day...

20
Support / Re: Multiple textures on a terrain
« on: October 02, 2012, 05:06:37 am »
Hi Egon,

How do you mean "map u/v accordingly to the height"?

I tried adding the transition colors to the textures but the transitions are not where I expected them to be? The textures seem to be rotated on their side?

I also had the thaught that I could create a scaled/graduated jpeg containing all the colors I need and then use some algorithm to select colors based on the models height. Is this what you are suggesting Egon? How would I do this?

I also thaught I may be able to use the pixel values similar to how jPCT-AE uses the Blit class??

21
Support / Re: Multiple textures on a terrain
« on: September 27, 2012, 11:34:48 pm »
Hi Egon,

I have made some great progress with my AR app. I finally understand the OpenGL coordinate system and have created a Lat/Long to OpenGL coordinate converter method to handle the live navigation.

I would now like to improve the rendering of my model. As you can see in the attached screen shot (you told me this would be the case) my model is jagged due to assigning a texture based on the vertex height.

I would now like to try a shader approach. I need to assign different textures based on the terrains height value. Could you please show me an example of shading a terrain using only the height values (or does the shader need x, y values also?).

[attachment deleted by admin]

22
Support / Camera.setPosition
« on: September 18, 2012, 07:21:51 am »
Hi,

How can I get the difference in z between the camera position and the terrain beneath the camera at its current position?

I want my camera position to always be at 2 units above the terrain.

Thanks in advance..

23
Support / Re: Multiple textures on a terrain
« on: September 06, 2012, 04:22:02 am »
Hi Egon,

Disregard the transformToGL() request. The engine already applies this to my model? Is this correct?

24
Support / Re: Set LookAt Matrix
« on: September 04, 2012, 06:06:56 am »
Hi AugTech,

Any chance you could explain how you used the GPS with jPCT-AE?

Pseudo code is great.

25
Projects / Re: Mesh serializer tool
« on: September 04, 2012, 05:47:27 am »
Hi Optical Illusion,

I have a single object (landscape) .3ds file that the Eclipse Mesh Serializer tool is splitting into four .ser files. I need to know the origin coords after the plugin has split the 3ds into four strips. Can you please explain how the plugin handles the splitting into strips?

Thanks

26
Support / Re: Multiple textures on a terrain
« on: September 02, 2012, 11:57:02 pm »
Screen shot showing correct orientation

[attachment deleted by admin]

27
Support / Re: Multiple textures on a terrain
« on: September 02, 2012, 11:52:49 pm »
Screen shot attached showing the models orientation on load.

[attachment deleted by admin]

28
Support / Re: Multiple textures on a terrain
« on: September 02, 2012, 11:40:33 pm »
Hi Egon,

I have succeeded with the Simple and ugly method. ;)

Code: [Select]
dem1 = Loader.loadSerializedObject(res.openRawResource(R.raw.jcu_lidar_gcs_0));
PolygonManager dem1PolyManager = dem1.getPolygonManager();
Logger.log("Max poly ID DEM1: " + dem1PolyManager.getMaxPolygonID());

for (int i = 0; i < dem1PolyManager.getMaxPolygonID(); i++) {
for (int j = 0; j < 3; j++) {
//Logger.log("Transformed vertex:" + i + "-" + j + " " + dem1PolyManager.getTransformedVertex(i, j).toString());
if (dem1PolyManager.getTransformedVertex(i, 0).z > 0 && dem1PolyManager.getTransformedVertex(i, 0).z < 50) {
dem1PolyManager.setPolygonTexture(i, tm.getTextureID("grey_texture"));
}

else if (dem1PolyManager.getTransformedVertex(i, 0).z > 50 && dem1PolyManager.getTransformedVertex(i, 0).z < 100) {
dem1PolyManager.setPolygonTexture(i, tm.getTextureID("green_texture"));
}

else if (dem1PolyManager.getTransformedVertex(i, 0).z > 100 && dem1PolyManager.getTransformedVertex(i, 0).z < 200) {
dem1PolyManager.setPolygonTexture(i, tm.getTextureID("blue_texture"));
}

else if (dem1PolyManager.getTransformedVertex(i, 0).z > 200 && dem1PolyManager.getTransformedVertex(i, 0).z < 300) {
dem1PolyManager.setPolygonTexture(i, tm.getTextureID("purple_texture"));
}

else if (dem1PolyManager.getTransformedVertex(i, 0).z > 300 && dem1PolyManager.getTransformedVertex(i, 0).z < 400) {
dem1PolyManager.setPolygonTexture(i, tm.getTextureID("red_texture"));
}

else {
dem1PolyManager.setPolygonTexture(i, tm.getTextureID("yellow_texture"));
}
}
}

I am now working on a way to blend the different textures to reduce the jagged edges.

Also, could you please explain how to use the tranformToGL() method. My model is in OpenGL coords, therefore it is on it's side... :o

Thanks for your help.

29
Support / Re: Multiple textures on a terrain
« on: August 29, 2012, 10:33:40 pm »
Hi Egon,

I am converting an Ascii GRID into a 3D Studio .3ds then serializing using the mesh serializer plugin.

So I need to access the polygon manager of my object, then using getTransformedVertex, for each vertex = some height, setPolygonTexture. BEFORE build().

Thanks again Egon..

30
Support / Re: Multiple textures on a terrain
« on: August 29, 2012, 05:55:57 am »
Hi Egon,

OK. I think the shaders may be over my head for now.  ;)

Do you have a snippet showing how to loop through the models polygons and assign textures to different height ranges (10m - 50m = texture A, 51m - 100m = texture B, ......). I think I will be able to reduce the number of textures down to around 5 - 10.

Also, do you have any idea on how I can convert the jPCT-AE world coordinate system into Lat/Long so I can place my model where it belongs in the "real world"? I will then also need to work out how to place the jPCT-AE camera at the devices "real world" coordinate from the GPS.

In summary, my idea is to place the model in it's "real world" location, then place the camera at the GPS location to enable the user to "look" around the model by moving the device (using the compass for direction) so long as the device is in the same location as the model.

Thanks Egon.

Pages: 1 [2] 3