about xcode

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: about xcode

Postby Julio Jerez » Wed Feb 23, 2011 10:52 am

I see the thre is a file name mac.diff in teh archive.

How do I use it? I do not see any commnad in Version that suggest a integration or merging?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby thedmd » Wed Feb 23, 2011 11:22 am

I'm afraid you will need to use command line to do this. Enter the root directory of your working copy of Newton and execute:
Code: Select all
patch -p0 -i <path_to_diff_file>


In TortoiseSVN you're using "Apply patch...", Versions does not have support for this. That's the only one inconvenience I found in this client.
thedmd
 

Re: about xcode

Postby Julio Jerez » Wed Feb 23, 2011 12:29 pm

Wow, I wodul call that a big ovesight, that soudn liek a nice funtionality to have. Maybe they add it in next version.
I will use torstoi in the PC them, I hate command lines tools.
But I have to be tonight, I am late for work now.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby Cannos » Wed Feb 23, 2011 6:53 pm

I tried making an iPhone configuration for newton.xcodeproj, but must have something set up wrong. Everything built fine, but the resulting library is 10.8 MB instead of 3 MB for the previous built version from 2.24. I'll wait until you have the other Mac issues worked out unless you have an idea of what I may have done wrong.
Cannos
 
Posts: 129
Joined: Thu Mar 04, 2010 5:41 pm

Re: about xcode

Postby Julio Jerez » Thu Feb 24, 2011 9:11 am

Ok I applied teh patch.

I made few modifications:
1- the Mac SDK was set to MACOS, I changed to MACOS 10.5
2- you harcde teh path to the midia file, that will cause crashe for people usin difrent roo folders, I make relative to the bundle and irt seem to work.
3- I fix the dThread, the bg was wit teh Atomics, In Mac they return a negated value than in Linux and Windows
4- I fixed the timer

witha that It seem to work but ther is still one bug.
It does not run in real time, some how OnIdle message is not triggered on my Mac, but is works on Window and Linux.
Did you get realtiem update of in you system?

Qt is very nice, but it too have some differences form OS to OS, I am going to have to ask again what I am doing wrong in the Mac
if you wna to follow the quetsion I am asking on teh Qt forum it is here: http://developer.qt.nokia.com/forums/viewthread/3895/P15/

Please Thedmc when you have time sync to SVN an dtell me if the integration still works for you.
also tell me if you get realtime updates, or just when you move the mouse, or touch a key?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby thedmd » Thu Feb 24, 2011 10:20 am

I will test your changes in a minute.

Why did you changed Base SDK to older one? Target minimum machine is controlled by deployment target, SDK is supposed to be set to latest version available. This similar to replacing Windows SDK headers with older ones. Nothing is really changed except bugfixes are missing and to use new features you need to provide defines and structure on your side.

I didn't get real time update, but I solved this problem in quite simple fashion. First of all, you can safety remove OnIdle() event. In the attachments you will find a patch to DemoEntityManager, this is a widget so it has timers. I simply created a timer with update interval 20 ms, in timer handling routine update() function is called and voila. Simulation is updated.
Attachments
fix.zip
Simulation update patch.
(769 Bytes) Downloaded 167 times
thedmd
 

Re: about xcode

Postby Julio Jerez » Thu Feb 24, 2011 10:44 am

I knwo about teh timer solution but the time is not good, it makse it run at a fix frame rate. It should runs a free doing an update each time there is not message pending.
I do not know why this is so hard with Qt, this is a stardand functionality on every other GUI I's seemed.
Let us see what the people at Qt has to say.
If they do not have an answer, I guees we can put that in and #ifdef/#end if block for the Mac

I changed to Mac OS 10.5 because is does not build on my machine if I do not do that.
It sayis: Path to MacSDK not found.
I guess it is because I have XCode 3.1
I will install xcode 3.2 and see if it work.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby Julio Jerez » Thu Feb 24, 2011 11:07 am

when I try to apply teh patch I get thsi error:

"the chunk size did not match the numbe of added/removed lines"

maybe it is corrupted, can you upload it again?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby thedmd » Thu Feb 24, 2011 11:12 am

Yes, old Xcode is the reason why SDK is not recognized.

On Mac you have NSPostWhenIdle notification type, but Qt do not use this. At least I didn't found an use of this in Qt sources. That's probably, because this event is asynchronous. There is what Qt says about the topic:
Qt Docs wrote:To make your application perform idle processing (i.e. executing a special function whenever there are no pending events), use a QTimer with 0 timeout. More sophisticated idle processing schemes can be achieved using processEvents().
Attachments
fix.zip
Updated fix.
(771 Bytes) Downloaded 169 times
thedmd
 

Re: about xcode

Postby Julio Jerez » Thu Feb 24, 2011 1:02 pm

I applied the patch.

This is what I am seeing, when I use OnIdle metho, the Maximun FSP I get in Linux 64 and Widows 7 is 2000 to 3000 fps. (the friction scene)
usind the time the Maximun is around 150 to 200 this is calling m_timerId = startTimer(0);

I guess that if the Mac guys do no come of with a solution I will IFdef out the time for the Mac and use the idle on PC and Linux.
So it should be fine in the end.
for now I will check it in with OnIdle commneted out and using the time method.

The the thing is that the OnIdle method on the Mac definitely does not work, after a while if Overflow some buffer and crash the OS really bad.

The time on teh Mac work very, very nice.
Even Keyboad imput sine to react better in teh Mac. :mrgreen:

I guess one more day and we are on buseness.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby Julio Jerez » Fri Feb 25, 2011 1:32 am

Ok thedmc I check in the last chnage to th aMak build.

I fix the dThread class and now can run teh graphics asyncronuos in a separate thread.
Newton in turn can also be mutithreaded.

I also finish some of the demo to add more interesting fetures. plsu teh keybodeios controll also work (wit the dlay but we do no have to make it perfect at thsi time)
The only thing left to do is the Mouse aiming and Mouse picking, and I beileve that will comple the demo viewer.
I will see if I can add those tow funtionality tomorrow.

This viewer does not need so many demos bacause the scene will save save from the editor.
Next week I will move to add few feayre to the editor so that pewopl can make or edit a least simple scenes an see them in the viewer.

I did not change the project yet, because I has not installed xcode 3.2.5 (I did not wnat to stop what I am doing now to deal with project files, but I will do it next time).
If you have tiem please sync to SVN and let me knwo if thsi works on yuor system.


On a side note:
today after I added a utility function that add some dynamics bodies to the world, I saw the FPS going down from, 3000 fps to 600 fps.
them I whent to get coffe thinking that something was wrong because the performance was loewring down a lot.
The I realiced, wow I start to spoile myself, 600 fps with 125 convex bodies in a static mesh with 60000 faces at 600 fps is nothing to be worried about.
This is just the work load of the system, It is a shame the mac does not runs at free fps.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby thedmd » Fri Feb 25, 2011 2:52 am

It's nice to see 2000 or 3000 FPS on Windows, but that's a delusional. In fact you're able to see 60 FPS, because this is the limit for you monitor (most likely). 60 FPS is also more that people can perceive. Of course those facts are not true everywhere.

First, you said that after adding bodies to simulation your FPS drop from 3000 to 600. Numbers are nice, but they are not linear and do not tell me nothing. 3000 FPS mean your single frame take 0.12 ms, after adding bodies, this time increased to 0.6 ms. Budget it set to 16 ms (for 60 FPS), idle simulation loops is around 1% of this time and grow up to 4%. Differences are not enormous. I was deceived by FPS a few years ago and since then I do not use this value as reliable unit of measure.

Running simulation... no... running rendering loop at 3000 FPS is still missing the point, every 10 to 30 rows of pixels on your window represents different simulation frame you may notice tearing of the straight lines while moving around the scene. This will be true as long as vertical sync is disabled.
Also 3000 FPS make your system less responsive, because your process consume all available CPU power. In other words, it's wasting the power by not doing something constructive. Physics is running at fixed step right? So in the result application redraw very same frame 50 times before you will be able to see it.
Matrix interpolation is making minor differences in the actual frame but those are very hard to spot on for static observer.

In my opinion it is reasonable to set timer interval to 16 ms and enjoy 60 FPS. CPU will have more time for physics.

Putting demo scenes from alchemedia in sample browser application is a good thing for you. But that doesn't show people how to use Newton. I think hard coded examples should also be available as a basic examples. Yet better if there will be XML scene which represents very same example that hardcoded one. In that case people will be able to see how to setup their own scenes and when they learn enough, they will be able to use XML scenes with more understanding.

There is a new patch in the attachments. It add ignores to SVN. That way *.mode1v3 and *.pbxuser files in Xcode project will not be seen by SVN. Those are local user settings for Xcode and they are named after your account name, so there is no point of having them on SVN (exactly like in case of *.suo from VS). Also I added ignores for 'build' directories located in same directory as Xcode projects, they contain only temporary data. This way you will not add them to SVN even by accident.

I can confirm, everything works with newtonDemo as expected. I use Xcode 3.2.5.

newtonDemo has a few issues related to the functionality. For example simulation options are reset when switching demos that's annoying IMOH.
thread load bar is not visible until number of micro threads is set to 2.

As a side note, Newton is amazing piece of work.
Attachments
ignore.zip
Ignores of Xcode local user settings files.
(413 Bytes) Downloaded 162 times
thedmd
 

Re: about xcode

Postby Julio Jerez » Fri Feb 25, 2011 7:28 am

Oh I agree with you in many points some point and disagree on few others.

for example the tearing on the screen is not as bad as you think, yet you are correct, but this viewer is not meant to be a high quality rendering engine,
it is merely a tool for visualizing functionality and performance, therefore minor glitches like tearing and are no of major concerns.
But that is not even a relevant point, I am quite happy with the fps synced to the monitor.

In the future Alchemedia the editor will have a launch viewer command when will call a viewer to check out the work.
The default viewer will be the editor, but later I will add other like OpenSceneGraph, maybe Ogre, or Irrlitch, and those engine do focus of high quality rendering.

The second point, I believe you are not right when you say the FPS sit akin the computer resource if ti runs at 3000 fps, but that is not so if you run on and idle event.
The idle event is only displace when the system if not doing anything, this is why you see that the drop so dramatically if you add any kind of load.
What you say is true if the display is force to be called at a fix rate on a timer, if the timer itself is a separate task that requires attention at a fix frequency, the high the frequency the more resurce it takes.


On the physics part, I use to have the same opinion that you have now, I always though that make demos step by step with the code was the way to present the potential of the engine.
But I realized that this is no so. Even for season physic programmers, visual modeling is way more powerful than procedurally programming.

To make an analogy, in early day of graphics before 3dstudio, Maya, and Softimage graphics was done mainly by highly trained programmers from SGI and it was all procedurally.
the with the introduction of graphics packages, graphics became the domain of any Game programmer, and I do not have to tell you the story of how computer graphics had evolved since them.
as an example it put the case of skinning a model. Programmer can figured out how the weight of the vertices works by just looking at how a loader interpreting the data.

But In any way the case your are making is exactly how the demo viewer is architected. There are two main menus with sub menus.
The file Menu is the part that will load scene made in and xml format in archemedia or any plug in that use the scene.lib archive system. I do not know if you notices but there is a Blender plug in there.
Larter I may make a Google sketchup too.

Then you have the Demo many witch expose the differences hardcode demos that come with the viewer. Adding a demo is a very straightforward thing, and I am sure that but now you provable seen the process.

The major problem with tah kind of demo is that only the interested party put attention to them, for the end user they are only interest in running them,
so if they is no way to expose some kind of physic modeling I will end in the same routine I has being until now. Mainlty every time
someone has a problem they have to make a test demo and I have to spend time figuring out how to debug it.

On the other hand if there was a system where you can take a physical scene and save you a file, they the debugging process become very simple, and contribute to the evolution on the engine and the tools.

The archive now is all c++, but to It will aso be converted to other languages like Pascal, Lua, Phyton, and so on. For that there is a their party tool called swigwin that convert the c++ header to other language.
I used very successfully to convert the scene library to Phyton to write the blender plugin. Later I will use to make convert to Lua, since most of the Archemedia command will be LUA driven.

I lay out a long turn plan for the engine, as you can see it is not small, and this is one of the main reasons I make open source, maintenance was consuming to much of my time and I could never make real progress.
If had not being even a week since the source is public, and you see how much progress we made already.
And the last thing, you are also correct there, the setting are lost when loading a new demo, I have not fix that yet, but it is in the list of the next steps together with the mouse aiming and picking,
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby Julio Jerez » Fri Feb 25, 2011 7:41 am

In try to apply the patch usung torstoiSVN, but when I click of teh file is doe no show anything at all.
before I say this file are changed and I click apply and it made the modifications.
you are right generated files should not be in source control.

I see they are many thing if the ignore.diff files, what I am doing wrong?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: about xcode

Postby thedmd » Fri Feb 25, 2011 9:57 am

I will reply to long post after the work.

However about TortoiseSVN. Patch I sent to you change properties of directories. Click on directory, select "Subversion" tab and then "Properties..." button. You will see svn:ignore properties has been added. This will work for example on folder containing Xcode project file.
thedmd
 

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest