开发者

how to create and interactive isometric frame for diagraming in a python GUI (preferable wxpython)

Am designing a piping software, right now it works on 2D. I implemented a very simple frame with wx.paintDC() it basically goes like this:

def OnDrawing(self, evt):
    dc = wx.PaintDC(self.leftWindow)
    self.leftWindow.PrepareDC(dc)
    dc.Clear()
    for image in self.images[1:]:
        x = image[1][0]
        y = image[1][1]
        img = wx.Image(image[0], wx.BITMAP_TYPE_ANY)
        bmp = wx.BitmapFromImage(img)
        dc.DrawBitmap(bmp, x, y, True)

The result is this [1]. The buttons on the right are used to add sections (pipes, valves, etc) to the right frame. when you click on a button the program calculate the position and draw it, so the frame its non interactive, you cant clic on the segments of pipe or valves, cant resize it, etc.

This its very easy and simple, but as a new programmer it cost me some time (and am fairly proud of it). now I want to improve that, what I want to do now is to create a 3D-like interactive frame, where the user could create "by mouse" the pipe diagram, click on them to change pro开发者_如何学Goperties etc.

what am aiming for its something like these [2] [3]. with a isometric background like this [4]

I guess thats not going to be easy (but neither was for me in the beginning what I did), but am decided to keep trying and studying to make it. What I want from you guys is directions..

Now I dont know where to start, am wondering "is this possible on wx?", "should I use openGL or something?". I need you to point to the right direction.

is this possible to implement with only wx? or I need pyopengl (witch I dont know anything about), or something like that?

thanks!!!...


You might want to investigate Python-Ogre. Ogre is an open source 3D engine, and Python-Ogre allows you to manipulate the scene through Python. This could allow you to focus on the user interface, instead of learning how to draw textured triangles with pyopengl.

http://python-ogre.org/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜