4
Contributors
10
Replies
12
Views
8 Years
Discussion Span
Last Post by isabel puchoc
0

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

0

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()
0

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

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.