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

Pages: 1 ... 3 4 [5] 6 7
Support / Re: Rotate camera around point
« on: February 12, 2011, 09:11:37 pm »
I'm probably being stupid, but I don't get it...  ???

Support / Rotate camera around point
« on: February 12, 2011, 04:21:26 pm »
How do I rotate my camera around the player when moving my finger over the screen? (on all axis)
what I currently have is this
Code: [Select]
camPos.x = (float) (Math.sin(me.getX()%360 * (Math.PI/180)) * -1.5f);
camPos.z = (float) (Math.cos(me.getX() * (Math.PI/180)) * 2.25f);

but this does not take the player position into account.. and is probably plain bad maths =p (i suck at them lols)

Kind regards,

Support / Re: Picking Objects (Pegando Objetos)
« on: February 10, 2011, 10:05:09 pm »
getY() - 24 might help. 24 is about the default height for a title bar, taskbar etc etc.

Support / Re: help with converting 3ds model
« on: February 09, 2011, 10:25:41 pm »
android does not work with c:/ or anything...
you need to use the sdk resources.

Support / Re: Polygon picking?
« on: February 09, 2011, 06:52:38 pm »
Ok, got something working, however i get coordinates like
x: -0.18257418
y: -0.91287094
z: 0.36514837

Code: [Select]
public void collision(CollisionEvent ce) {
if (ce.getType()==CollisionEvent.TYPE_TARGET) {
PolygonManager pm = terrain.getPolygonManager();
SimpleVector polypos = pm.getTransformedNormal(ce.getPolygonIDs()[0]);

edit: got it working by changing getTransformedNormal to getTransformedVertex :D

Support / Polygon picking?
« on: February 09, 2011, 11:01:35 am »
So I got my terrain now.
What I need now is something like polygon picking?
I want to be able to tap the terrain at any position and return the world-space coordinates of where I tapped the terrain.
I think the most logical way to do this is to check which polygon is being tapped on, and return it's (x y and z) position..
I was looking at but the 'fast way' does not work on android ( ? ) as world.getVisibilityList() does not exist..

Support / Re: Landscape, Model or Heightmap?
« on: February 09, 2011, 09:50:27 am »
*testing it*
Wow, that was like.... instant :o
thanks. :)

Support / Re: Landscape, Model or Heightmap?
« on: February 08, 2011, 11:34:16 pm »
lol wow, the zipped file became like 1.7mb :o
however.. using ZipInputStream on android takes forever to extract the 18mb file, and ran out of memory..
so I manually resized the heightmap to 128 and the ser file became 4mb, zip file now is only 644.2kb but still loading takes a while.
or I am doing something wrong..

Code: [Select]
ByteArrayOutputStream terr = new ByteArrayOutputStream();
ByteArrayOutputStream terrTexture = new ByteArrayOutputStream();

try {
ZipInputStream zip = new ZipInputStream(res.openRawResource(R.raw.terrain));
ZipEntry ze = null;
while ((ze = zip.getNextEntry()) != null) {
for (int c =; c != -1; c = {
for (int c =; c != -1; c = {
} catch (IOException e) {
tm.addTexture("terrainTexture", new Texture(new ByteArrayInputStream(terrTexture.toByteArray()), false));
Object3D terrain = Loader.loadSerializedObject(new ByteArrayInputStream(terr.toByteArray()));

Support / Re: Landscape, Model or Heightmap?
« on: February 08, 2011, 04:51:49 pm »
yay, got it working....
exporting as ser file works too, except for the fact that it becomes a 16mb file O.o
is there a possibility script-wise, to reduce the polygons? as 65536 is kind of A LOT.

edit: resized my heightmap manually to 128x128, but that still leaves me with a 4mb file... personally I think that is too large..

Support / Framerate and movement
« on: February 07, 2011, 09:25:10 pm »
When moving an object in the render loop.. lets say.. rotateX(0.01f); it will rotate faster with higher framerate and rotates slower with lower framerate..
If i remember correctly, some other sdk i once used had a function or something called AccurateTimeElapsed..
I'm not sure what it does but when calling eg, rotateX(0.001f * AccurateTimeElapsed); it would rotate at the same speed on any framerate..
is there some similar method or whatever in jPCT?
Or if someone knows how it works so that I can implement it myself ?

Kind regards,

Support / Re: Landscape, Model or Heightmap?
« on: February 07, 2011, 08:50:18 pm »
Ok, I got the pixel data now... I think..

I got a 256x256 image, so the length should be 256*256=65536, however it is 65792...
What else is in there?

Also, the pixel data in int[] is a number eg. 11053224.... what is it, and how can I 'transform' it into something I need for heightmaps?

Support / Re: help with converting 3ds model
« on: February 07, 2011, 12:10:09 pm »
try reinstalling / upgrading java.

Support / Re: Landscape, Model or Heightmap?
« on: February 06, 2011, 06:42:02 pm »

Wait......... what?

Support / Re: Landscape, Model or Heightmap?
« on: February 05, 2011, 01:07:20 pm »
hmm, cant seem to figure it out,
got an example by any chance ?

Support / Re: Landscape, Model or Heightmap?
« on: February 05, 2011, 11:56:02 am »
How do i get the pixel data from an texture in jpct desktop version?

Pages: 1 ... 3 4 [5] 6 7