Jump to content

Ot Python And Cgkit


peliosis

Recommended Posts

Hello,

This is a bit off topic but I know if there are answers to my tears they hide in the depths of THIS very forum:)

I learn python intensively lately, began using cgkit to proccess 3d data and have some questions.

How would it be possible to display data in some openGL viewer dynamically?

For example, I have a file containing a simple geometry, and this file changes because new vertices are continuosly added (in 3d scanning process).

But cgkit viewer is executed only once with predefined, constant file (python viewer.py myfile.py).

Because I'm not a very experienced programmer :P I don't know how could I make a viewer update, to display new data.

Probably cgkit viewer can do this at all.

Do you see a solution to this attempt?

Maybe I should use another viewer? I had a look at ogre, at PyOpenGL, but handling these is beyond my possibilities for at least a month:)

Thanks for any insight.

Link to comment
Share on other sites

Not that I know anything in python beyond basic addition and printing :) but maybe you can try VTK (with MayaVi)? I think it can display some changing data, but maybe I am thoroughly confused. Or simply re-open the file in cgkit after a specific interval (lame, I know)?

Link to comment
Share on other sites

hey peliosis!

sorry for delay, I've just lost my laptop and I couldn't find any workstation around ;)

Do you still have your problem with starting cgkit script?

As to your question about piping in data to viewer, you have to put showing statement in to a loop:

while _show == 1:
	date = update_my_data( )
	world = make_some_sims(date)
	etc()
	etc()
	show_me_the_world( world ) 
	if condition != something: _show = 0

look here for video introduction to VPathon:

http://showmedo.com/videos/series?name=pyt...onVPythonSeries

it's applicable to cgkit also (to some extend of cource)

sie masz!

sy.

Edited by SYmek
Link to comment
Share on other sites

HiSy!

Thanks for your reply,

I sort of know how this procedure should work, but there is one catch...

"show_me_the_world(world)" :D

If it were a real function to refresh the viewer, I would not bother you at all :)

I haven't found such function yet and that's why I ask.

addSomePoints()
updateViewer()

Link to comment
Share on other sites

I'm sorry, I didn't understand you ;)

is that what you need?

sy

Great link SYmek!

I made a quick test and it does look like a solution I look for.

Thanks a lot

By the way, do you have the same experience with viewer.py? It eats my processor out even when doing nothing, looks like it calculates all the time.

Link to comment
Share on other sites

Great link SYmek!

I made a quick test and it does look like a solution I look for.

Thanks a lot

By the way, do you have the same experience with viewer.py? It eats my processor out even when doing nothing, looks like it calculates all the time.

Yes it does, because it's based on the "while" loop. You can write your own tools built in the script it self. Viewer doesn't know whether your scene is changing or not so it refreshes all params.

Edited by SYmek
Link to comment
Share on other sites

Yes it does, because it's based on the "while" loop. You can write your own tools built in the script it self. Viewer doesn't know whether your scene is changing or not so it refreshes all params.

ah SO!

that little insidious devil... ;>

Thanks SYmek

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...