Main Menu
Menu

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.

Show posts Menu

Messages - Peter Dym

#1
Support / Re: Object rotation vs. world axes
May 31, 2013, 09:19:14 AM
Thanx, "strongly advised" from author means a rule. So I am using a texture now. I just wanted to save one texture and to have a big bitmap with all controls/buttons/icons.
#2
Support / Re: Object rotation vs. world axes
May 29, 2013, 08:54:24 PM
Hi Egon! I am back to my Airdroid project and want to continue and finish it. I have one problem now which is blocking me a little bit. It is a blit function which does not work like I am expecting. What I need is to have a bitmap with a few pictures and to blit a part of the bitmap to the fb. So I have:

   fb.blit(intArray,bitmapwidth,bitmapheight,0,0, 100,100, partialdx,partialdy, FrameBuffer.TRANSPARENT_BLITTING);


I am expecting that there will be rendered a part of my bitmap started from 0,0, with a width and height =partialdx, partialdy at position 100,100.

But the result is that the whole bitmap is always rendered onto fb. Regardless of partialdx, partialdy.

What I am doing wrong?

Regards,

Peter.
#3
Support / Re: Reflection efect
May 29, 2013, 08:43:47 PM
just fyi:

I had to work on something alse to make some money so no 3d games :-) and then I was asked to do a prototype of a 3d viewer. This is the result:

http://www.youtube.com/watch?v=V9gPfFFT4pM
http://www.youtube.com/watch?v=vlhMONC_AQY

#4
Support / Re: Reflection efect
July 10, 2012, 05:55:17 PM
Hi Egon,

I know, this is the old thread, but related to my actuqal problem. I was asked in my office to show a simple window with one rotated object. I piece of cake.
I am familiar with jpct so no problem. And I spent 2 days or more to do it in the reasonable quality and - no way. It should be very realistic and I'm missing the bacis reflection feature. And have no idea how to do it. I'm not total beginer (see my Airdroid project http://www.jpct.net/projects.html ) but to create an usable specular reflection is too much. I'm not restricted by Android OS or by performance because it should be an applet with one rotated object (which I have already done but - I have nothing to show actually). I need something like http://www.esko.com/en/Products/overview/studio/visualizer-gallery . Is there a way how to do that? I was so despaerate that I started with jMonekyEngine, which looks good but every step was and is accompanied with very exotic exceptions like "Your object does not contain faces" or "Expected version of something is lover that provided" :-) . So I would rather stay wit our cute jpct. Any suggestion?
#5
Support / Re: Object rotation vs. world axes
June 02, 2012, 05:26:45 PM
Hi Egon,

this can finally be another project using jPCT-AE. A beta version but already exists and almost all problems are resolved.

http://c-vitae.yolasite.com/airdroid.php

#6
Support / Re: Object rotation vs. world axes
April 11, 2012, 09:53:29 PM
Thank you for the offer to process my plane.
The zip size exceeds 64  kb allowed here for the attachement. So one texture is missing (mig29wave0.png)- you can use any png  256x256 and I will replace it. If you let me know the address where I can send the whole stuff I will do that.
Thanks again.

...and here is the example of my cripled plane and your matrices interpolation :

http://www.youtube.com/watch?v=70yEKR8qfPk

(2 rockets are lunched to the target. If the target is damaged by the first rocket the second one is recalculating the path and turning to the second target)



[attachment deleted by admin]
#7
Support / Re: Object rotation vs. world axes
April 11, 2012, 07:18:38 PM
Hi Egon, I do not know if I should ask here, because it is simply another problem, but I have it in this project so...after having the rockets navi done I wanted to do some simplification on my objects. And I'm fighting the whole day with one problem. My object is not shown correctly anymore. The plane is without wings :-)
I recreated the wings completely, I'm playing with settings, doing a copy of the correctly shown parts and modifying them like wings...nothing. And I'm asking here because of two things (I'm using the obj format):

1. Names are not set when obj is read. Simply the names are like "_jPCT...". Without the original name.

2. There is a warning shown:
"WARNING: This OBJ-file contains n-polygons with n>4! These polygons wont be displayed correctly!"
and because there is no name - I can not identify the wrong component.

...and my object is not displayed correctly.

Any idea what to do?

Thanks.
#8
Support / Re: Object rotation vs. world axes
April 09, 2012, 12:58:46 PM
I haven't noticed the interpolate method. Sorry. It works great ! It works better than great :- ! Thank you. I will post a video if  I find a better way to grab it than to hold my camera in one hand and the phone in the second hand.

Edit: jPCT-AE is cool btw.
#9
Support / Re: Object rotation vs. world axes
April 08, 2012, 05:48:15 PM
My problem is now how to interpolate vector to "turn" it to the given direction:

- If I create a test object and
- if I calculate the direction vector to the target and
- the rotation matrix of the vector is then used for the the test object,

it works well - always pointing to my target.
But how to do do it incrementally? I do not know. This is the code:


...
// returns a vector from the source position to the target pos.
SimpleVector dir=Chaser.getDirection(sourceObj, targetObj);

// set the directon to point to the target
testObject.setRotationMatrix(dir.getRotationMatrix());

// and put the testObject to the source to see it
testObject.translate(sourceObj.getTranslation());
...


In the attached pictures is shown how my test object (the arrow) always points to the target (the baloon).
I would like my launched rocket to incrementally turn towards the target and hit it. Now I'm still missing something :-)


(http://www.youtube.com/watch?v=DrPFrDcffc4)



[attachment deleted by admin]
#10
Thanx, the problem is that I do not know how to interpolate neither vector nor matrix.
I'm trying  but no joy.
- If I create a test object and
- if I calculate the direction vector to the target and
- the rotation matrix of the vector is then used for the the test object,

it works well - always pointing to my target.
But how to do do it incrementally? I do not know. This is the code:

// reset the testObject - which is flying  in the world
testObject.clearTranslation();
testObject.clearRotation();
// returns a vector from the source position to the target pos.
SimpleVector dir=Chaser.getDirection(sourceObj, targetObj);
// set the directon to point to the target
testObject.setRotationMatrix(dir.getRotationMatrix());
// and put the testObject to the source to seeit
testObject.translate(sourceObj.getTranslation());
// and a liitle bit up
testObject.translate(0, 5,0);

Here I cannot attache pictures so I added them to my original thread related to the propject I'm working on:

http://www.jpct.net/forum2/index.php/topic,2592.msg19344.html#msg19344




#11
Hi All,
I have a similar problem. I have a rocket launched from the plane. And I would like this rocket to slowly turn to the target. Actuall to have a guided rocket. In the discussion above is decribed how to get the right rotation matrix - but I would like to turn the rocket to the target in steps. Any ideas?

http://www.youtube.com/watch?v=DrPFrDcffc4&feature=youtu.be
#12
Support / Re: Object rotation vs. world axes
March 06, 2012, 10:55:29 PM
Just as an update: after some fighting I think that I have it. An endless world. I want to check if it is practically usable. But if I have something to show/share I will try to post a link to video which can be better than screenshots in this case. 
#13
Support / Re: Object rotation vs. world axes
March 03, 2012, 12:21:49 AM
Thanx.  Actually - may be there is programmed one sexy feature. The terrain consists of 9 tiles. These tiles are modified by height bitmaps. So far so simple, nothing special. The central tile is different - with an airport in the middle. Other tiles are 100% symetrical. It means that their borders are the same = each corresponding point  is at the same altitude so they can be arbitrary combined without having known gaps, holes or emtpy spaces.  All tiles are sharing only one mesh.  They are always creating a compact land. Why? because my intention was to move tiles in dependency of the camera position. If the fog/visibility is set to approx. 2/3 of the tile width and the camera is looking to the given direction , the tiles behind (invisible) can be translated to the position which would create an endless terrain. The texture can be even changed so the tiles do not look similar. Finally the texture will be blended with some details so the feeling should be even more realistic. Unfortunatelly my invention was totally exhausted by the described feature and I'm not able to find the "formula" to detect when and which tile should be translated to the new position if it should be visible in the current "lookAt" direction (and is invisible in the back of camera).
As you see I'm solving a lot of problems and it probably needs some time. (some basic problems like animated textures, fonts for blitting, transparent explosions and smoke, terrain generator, some extra problems like 3d models and their wrong positioning, flying model, collision system (which I can succesfully use, but I do not understand it :-) , and some additional problems like sound (looping, the end detection, queing and correctly stopping...), android views and components, airspeak techniques and lessons...). But it looks promissing. I do not want to think about the Android market and own application there...But if anbody has an idea how to deal with my 9-tiled world, it would be appreciated.
To illustate what I'm talking about, please, see the attached simplified terrain picture (fog is disabled, tiles are shrinked and distances between tiles are added).

[attachment deleted by admin]
#14
Support / Re: Object rotation vs. world axes
March 01, 2012, 08:19:45 PM
Thanks Egon. It's is hard to explain. 
Concerning "zeroing" the z axis: I supposed that I should do it for the airplane only and comparing it with world (1,0,0) which has also "z=0". If I do not set airplane.z=0 then I would calculate the "space" angle which is different than the "flat plane" angle which I'm interested in only. An angle between airplane.x and abstract vector (1,0,0). But you are right, of course, it is not such simple.

The upside down problem is clear, I used it only as an example how confusing is the whole stuff.

And to landing - actually I can use the normals taken from the runway to know how the airplane "should be" positioned. But I do not know if it is. This is the whole problem. If my explanation is too confusing, we can leave it. It is probably too much to me and I should rather programm a bublesorting of integers.
Otherwise I have another bunch of questions/problem which I would really like to ask. But they are so specific, that I do not know if it makes sense. May be the thread should be named - Android fly simulator, questions and answers for desperate (and lazy)  programmers.

And finally one practical question:
There is a warning message concerning the materials and colors are not rendered correctly. All problematic materials are rendered black (see the attachment) . The proposal says :
"WARNING: Error reading material's diffuse color...try Config.oldStyle3DSLoader=true!"
but in the AE there is no such option. Any suggestion?

Btw - thanx for jpct-AE. I love it.


[attachment deleted by admin]
#15
Support / Re: Object rotation vs. world axes
February 29, 2012, 09:40:32 PM
Thank you very much Egon, but I'm too simple to get the reasonable results. Of course I'm reading the docu and calcAngle was the first try, but problem is to build/find/select  the right parameters. I'm always getting different angles like if all angles depend on others. I was starting with something like :

SimpleVector vecx=airplane.getX(); // so I have one axis
set vecx.z=0 ; // to have only a flat plane to measure  (?)
vecx.calcAngle(SimpleVector(1,0,0);

But I have only confusing values. And if my airplane is upside-down, it is time for ejection - No angle is like expected.
The project is about radiotelephony communication for pilots (non commercial, just my hobby) but a nice 3d environment is actually why I'm doing that.
Because I did not have a solution, I was working on other features, som my peacefull biplane can shut down ballons now, can crash and can make smoke and explosions - which was not in the original "requirement". But is still not able to land, see the attachment  ;)  :



[attachment deleted by admin]