Just a curious Question,
Is there a way of putting Vpython in wxpython as we do in case of wx.MediaCtrl and other stuffs?

Recommended Answers

All 10 Replies

Vpython and wxPython each use their own event loops, so it will not be easy and very smooth.

So not possible?
How difficult and effective is pyOpenGL compared to Vpython?
Can anyone give a simple comparison?

Anyone with update on the two frameworks

The Open Graphics Library (OGL) is now well integrated with wxPython, but to go from there to something that works like VPython you need lots of work:

import wx
import wx.lib.ogl as ogl

class MyFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__( self, None, wx.ID_ANY,
            title="explore wx.lib.ogl", size=(400,300))

        canvas = ogl.ShapeCanvas(self)
        canvas.SetBackgroundColour("yellow")

        diagram = ogl.Diagram()
        # marry the two ...
        canvas.SetDiagram(diagram)
        diagram.SetCanvas(canvas)

        # create some standard shapes ...
        # (check how creation order affects overlap)
        circle = ogl.CircleShape(100.0) # radius
        circle.SetX(75.0)  # center x
        circle.SetY(75.0)
        circle.SetPen(wx.RED_PEN)
        circle.SetBrush(wx.CYAN_BRUSH)
        canvas.AddShape(circle)

        text = ogl.TextShape(250, 30)  # (w, h)
        text.SetX(180)  # center x
        text.SetY(240)
        text.AddText("you can drag the circle or the text")
        canvas.AddShape(text)

        diagram.ShowAll(True)

        # use v box sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        # canvas will grow as frame is stretched
        sizer.Add(canvas, 1, wx.GROW)
        self.SetSizer(sizer)


app = wx.App()
ogl.OGLInitialize()
MyFrame().Show()
app.MainLoop()

Any documentation on Open GL in wxPython?

hello I am using wxPython and the graphics I use import visual and from visual.graph import*, but I can't see nothing , i don't have error but I don't see nothing either, somebody Know why is that?
because my program is ok without wxPython, but when I put interface with wxPython it doesn't run

Hav you read the thread?
they are not yet integrated. So I think good candindate to answer this question is Vpython mailing list or wxPython ones. They are both very active lists

I haven't read the thread, where can I find?

where can I find some tutorial, because I don't have any error , but I can't see my graphic.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.