A couple of questions...

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

A couple of questions...

Postby gsaous » Mon May 03, 2010 7:05 am

Hi guys,
Fortunately, at last I have the demo running since Friday and I think I have got a gut picture of what it does(I read about 15 hours per day to understand, but it seems that I have a result, so it doesn't matter..:P), but since I'm still a starter I have some questions that i think they are easy for you to answer.

1) As I saw, the starting scene(in the demo the floor) is loaded from a dae file named flatplane. I tried to create a room creating a dae file with google sketchup 7
but the result is not what I expected... It looks like a grey shade far away...:S. Do you know what may be wrong?

2)In previous demos, the camera is able to move, and as I saw, the code for the camera to move exists in the 2.19 demo (that i use) but function keyboard that contains this code never executes. Is there an easy way to make the camera move by existing code, or I have to do it from skratch in the function onkeydown in rendercanvas?

3) I tried to understand how the primitives are build, because i want to add a pyramid and a trapezoid, but i don't know how. I saw that for the box, for example, there is a file dombox but no matter how hard i tried to understand it, i didn't make it to understand what it does...

Thanks in advance for your time.
gsaous
 
Posts: 22
Joined: Sat Apr 24, 2010 2:25 pm

Re: A couple of questions...

Postby Julio Jerez » Mon May 03, 2010 9:43 am

Ah it is cool you try to use Collada files made with other packages like sketchup. That is precisely the reason I move to Collada format.
gsaous wrote:Hi guys,
... I read about 15 hours per day to understand, but it seems that I have a result, so it doesn't matter..:P), but since I'm still a starter I have some questions that i think they are easy for you to answer.

what were you reading?

-if you think the Collada mesh you load does not look correct, maybe you can post it here and I can take a look. If it is too big maybe you can make a small sample the expose the problem.
I tested the loader with few sketchup graphics files, but not with many physic files since I could not find any.

-The camera code is no active yet because I was stuck in getting teh toolbar in WxWidget.
I will make more progress in the controls for 2.21

-For adding Pyramid and Trapezoids to the Scene if you just want to test you can also make the in a Collada Scene in Sketch up and it should work.
If you want to use it to load model into you own project, you can check out the third Library called animation in the Newton collection
This is the interface;
Code: Select all
class dSceneModelList: public dList<dModel*>
{
   public:
   dSceneModelList();
   ~dSceneModelList();

   void AddModel (dModel* model);
   void RemoveModel (dModel* model);

   void ExportVisualScene (const char* fileName, const dMatrix& globalRotation, dFloat scale);
   void ImportVisualScene (const char* fileName, dLoaderContext& context, const dMatrix& globalRotation, dFloat scale);

   void ExportPhysicsScene (const char* fileName, NewtonWorld* world, const dMatrix& globalRotation, dFloat scale);
   void ImportPhysicsScene (const char* fileName, NewtonWorld* world, dLoaderContext& context, const dMatrix& globalRotation, dFloat scale);
};


As you can see if you create a world, and you have a collada mesh, you can just call

Code: Select all
dSceneModelList scene;
dLoaderContext context;
dMatrix globalRotation (identity);
float scale = 1.0f;
scene.ImportPhysicsScene (“colladaFileName”, world, context, globalRotation, scale);

and it will load the scene with everything, graphics and Physics,
then you can iterate the Graphics or teh Physics bodies and collect the data you need.
But you do not even have to iterate you can collect the date in the dLoaderContext as it si read from the file.

In the Next version of Newton the There will be Chunk based binary mode for loading and saving as well.
But maybe I will not have to do it since Collada people said they will make a Binary version too.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A couple of questions...

Postby gsaous » Mon May 03, 2010 10:21 am

i'm uploading the dae file that was supposed to be a room(ok it's a zip file because it doesn't let me upload a dae file...)
It's just an exaple to see what it would look like, I have made many other rooms with different sizes and coordinates but it always looks something like that when i load it to the demo...:(

And one more question, do you think the 2.21 will take you to long to finish? is there anything i can do to make the keyboard function, in physicsutils file, get triggered when i press a button instead of the keyup/down in the rendercanvas file?
Attachments
room.zip
(2.3 KiB) Downloaded 108 times
gsaous
 
Posts: 22
Joined: Sat Apr 24, 2010 2:25 pm

Re: A couple of questions...

Postby Julio Jerez » Mon May 03, 2010 11:03 am

Ok I think the file is no right because it is making refrence to collada elements that are no in the file
here is an example
<node id="ID3" name="Sang">
<instance_geometry url="#ID4">
<bind_material>
<technique_common>
<instance_material symbol="Material2" target="#ID5">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0" />
</instance_material>
<instance_material symbol="Material3" target="#ID10">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0" />
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
<instance_geometry url="#ID14">
<bind_material>
<technique_common>
<instance_material symbol="Material2" target="#ID10">
<bind_vertex_input semantic="UVSET0" input_semantic="TEXCOORD" input_set="0" />
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>



the lines where try to read the geometry intances

<instance_geometry url="#ID4">
<instance_geometry url="#ID14">
...

are not in the file, in fact the only geomery in that file
<geometry id="Plane01_node">

is not referenced by the any node in the file anywhere else. So I do not know how that file can be read.
can Google Collda loader read url in one file and locate them in different files?
My plug in does not do that, but I do not think Collada specification allow for that either.
I tryed the Collada consistency test and I fail too.

How did you make the file? and where are the Geometries.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A couple of questions...

Postby gsaous » Mon May 03, 2010 11:11 am

ok, wrong file... sorry
please check this one, that doesn't have problems with references...
Attachments
anoixto.zip
(14.53 KiB) Downloaded 117 times
gsaous
 
Posts: 22
Joined: Sat Apr 24, 2010 2:25 pm

Re: A couple of questions...

Postby Julio Jerez » Mon May 03, 2010 11:34 am

Ha this is better; I see what the problem is now.
I see a big open box and inside there seem to be a small mesh made of a group of irregular faces.
It is all white because my importer does no handle Color Materials yet, at this time it only supports single textured faces, all material are st to white diffuse color.
You mesh does not have textures
<input semantic="POSITION" source="#ID171" />
<input semantic="NORMAL" source="#ID172" />
If you place a single place holder texture it sopdul be fine.

In the future I will add more Graphics funtionality. for now all material are just plain white phong
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A couple of questions...

Postby gsaous » Mon May 03, 2010 12:53 pm

i don't really understand what i have to do...
did you use my "room" in the demo, or you opened it using an other tool?
gsaous
 
Posts: 22
Joined: Sat Apr 24, 2010 2:25 pm

Re: A couple of questions...

Postby Julio Jerez » Mon May 03, 2010 4:35 pm

I loaded in the Milkshape plugin. It is in the toolchain forder in the SDK an dit use teh same SDK library.

the reason I use the model plugin is that I have navegaion, the SDK demo do no have any navagation now. so unless teh mesh is in front of teh Camera I will no see it.


What I said is that the Collada importer right now do not has the ability to load meshes with material color only.
you need to place a texture to see it. any texture with a Box Mapping will do.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A couple of questions...

Postby gsaous » Fri May 07, 2010 11:59 am

hi again, after trying one whole week with google sketch up I'm still in the beggining... Ican't create one room! Sometimes i see some of the walls but not all of them and not with the right texture, for example i use the brickwall you have in demo and it looks dark grey...
Moreover the walls don't have any collision, if i add a sphere ffor example and i push it towards the wall, the sphere passes throught the wall!!!

I'm sending you once more, one of the many examples i've made...

i hope you can understand something...
Attachments
room.rar
(2.11 KiB) Downloaded 116 times
gsaous
 
Posts: 22
Joined: Sat Apr 24, 2010 2:25 pm

Re: A couple of questions...

Postby Julio Jerez » Fri May 07, 2010 12:14 pm

I see a box with 4 wall, and not floor, when I add the brick texture, the 4 walls look fine to me.

see if you can load a mesh from the SDK in google sketchup and re expert with a different name, then load in the SDK see if it load fine.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A couple of questions...

Postby Julio Jerez » Fri May 07, 2010 12:23 pm

I load it in the SDK and it is correct,

The problem is that that part of the Mesh is outside the Camera View.

How about if I make one simple Box that you can load is Goggle and is center in the camera field of View, that will clear if is right in both Google and the SDK.
you should be able to export any scene from Goggle and see in the SDK.
But they will not have physics if they file is not a Physics file.

In the next Build this week end I will add Navigation to the Demo, and I will also add the ability to edit Visual Mesh so eth you can add the Physics objects.
Right now Mesh can only be Visual unless they are already Physic subjects.

I hope you understand.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A couple of questions...

Postby gsaous » Fri May 07, 2010 1:04 pm

ok, i can't load any of the existing dae of the demo in the google sketch up..:(

what tool can i use to create my room? and how can I make it have the physics too?

thnx a lot for the quick response
gsaous
 
Posts: 22
Joined: Sat Apr 24, 2010 2:25 pm

Re: A couple of questions...

Postby Julio Jerez » Fri May 07, 2010 1:27 pm

gsaous wrote:ok, i can't load any of the existing dae of the demo in the google sketch up..:(

why not? those are legitimate Collada files google soudl read the without problems. did you get any error?
how do I get Google Skechup?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A couple of questions...

Postby gsaous » Fri May 07, 2010 1:30 pm

gsaous
 
Posts: 22
Joined: Sat Apr 24, 2010 2:25 pm

Re: A couple of questions...

Postby gsaous » Fri May 07, 2010 1:35 pm

it says it encountered an error and it has to close...

which tool have you used to create the scenes?

how can i also have physics in my scene?
gsaous
 
Posts: 22
Joined: Sat Apr 24, 2010 2:25 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron