I'm sure this has been asked before, but I cannot find any mention of
it.
I've been using pyglet with ImageGrid to place a number of animated 2D
sprites. I want to now draw lines between them using OpenGL. Can I
do this without having to first move my 2D sprites to OpenGL textured
quads (or similar?) Is this possible?
I am new to OpenGL and am working through NeHe and the Red Book.
> I've been using pyglet with ImageGrid to place a number of animated 2D
> sprites. I want to now draw lines between them using OpenGL. Can I
> do this without having to first move my 2D sprites to OpenGL textured
> quads (or similar?) Is this possible?
> > I've been using pyglet with ImageGrid to place a number of animated 2D
> > sprites. I want to now draw lines between them using OpenGL. Can I
> > do this without having to first move my 2D sprites to OpenGL textured
> > quads (or similar?) Is this possible?
On Feb 11, 2008 4:51 PM, jotham <jotham.r...@gmail.com> wrote:
> Well, I guess I should have said. I had a play around before posting > here and could not figure out how to do it. Could you provide a > simple test case?
How about we make a compromise. Try to get it done first on your own by:
1. Learning some OpenGL basics 2. Reading the documentation for pyglet
If you're still lost, post your broken code and we'll be glad to make further suggestions. If you want me to write code for you, that's fine as well - just contact me for an estimate (I accept paypal or money orders).
You guys are remarkably caustic. I imagine you'll only respond to this
opinion with more of the same, but I thought I'd throw that out there.
If it only takes you thirty seconds to give a quick overview, then why
not? Is it some sort of trade secret? If it's more involved, then
there is certainly no harm in telling him so in nicer terms. He is
already making the effort to learn.
Unfortunately, I don't have the answer myself, because I am in a
similar position. I only started reading the Red Book a couple of
weeks ago and my demanding class schedule has kept me from getting
past Chapter 2 so far. But I'm trying.
As a possible hint to the original poster: I speculate that it
involves getting out of orthographic mode, drawing all that 3D stuff
with OpenGL, getting back into orthographic mode, and then drawing all
the regular stuff the normal pyglet way, with images, etc.
On Feb 11, 5:11 pm, "Drew Smathers" <drew.smath...@gmail.com> wrote:
> On Feb 11, 2008 4:51 PM, jotham <jotham.r...@gmail.com> wrote:
> > Well, I guess I should have said. I had a play around before posting
> > here and could not figure out how to do it. Could you provide a
> > simple test case?
> How about we make a compromise. Try to get it done first on your own by:
> 1. Learning some OpenGL basics
> 2. Reading the documentation for pyglet
> If you're still lost, post your broken code and we'll be glad to make
> further suggestions. If you want me to write code for you, that's fine as
> well - just contact me for an estimate (I accept paypal or money orders).
You guys are remarkably caustic. I imagine you'll only respond to this
opinion with more of the same, but I thought I'd throw that out there.
If it only takes you thirty seconds to give a quick overview, then why
not? Is it some sort of trade secret? If it's more involved, then
there is certainly no harm in telling him so in nicer terms. He is
already making the effort to learn.
Unfortunately, I don't have the answer myself, because I am in a
similar position. I only started reading the Red Book a couple of
weeks ago and my demanding class schedule has kept me from getting
past Chapter 2 so far. But I'm trying.
As a possible hint to the original poster: I speculate that it
involves getting out of orthographic mode, drawing all that 3D stuff
with OpenGL, getting back into orthographic mode, and then drawing all
the regular stuff the normal pyglet way, with images, etc.
On Feb 11, 5:11 pm, "Drew Smathers" <drew.smath...@gmail.com> wrote:
> On Feb 11, 2008 4:51 PM, jotham <jotham.r...@gmail.com> wrote:
> > Well, I guess I should have said. I had a play around before posting
> > here and could not figure out how to do it. Could you provide a
> > simple test case?
> How about we make a compromise. Try to get it done first on your own by:
> 1. Learning some OpenGL basics
> 2. Reading the documentation for pyglet
> If you're still lost, post your broken code and we'll be glad to make
> further suggestions. If you want me to write code for you, that's fine as
> well - just contact me for an estimate (I accept paypal or money orders).
Well, everything except the last sentence was reasonable (and I thought it a bit blunt too and set the tone of the response).
I am just beginning (with OpenGL) as well or I would chip in. I think the point was if the original poster could include at least a snippet of what he/she tried to do, people would be more willing to respond with code suggestions. It is hard to come up with sample code for everyone asking. It would be much easier to point to a sample or some docs, but I don't think there are any on this subject (yet).
Maybe a wiki or some other form of code samples that people could contribute to would help here? Then us noobs could post solutions to these sorts of problems as we conquered them and save some strife.
M.
On 2/11/08, dior...@gmail.com <dior...@gmail.com> wrote:
> You guys are remarkably caustic. I imagine you'll only respond to this > opinion with more of the same, but I thought I'd throw that out there. > If it only takes you thirty seconds to give a quick overview, then why > not? Is it some sort of trade secret? If it's more involved, then > there is certainly no harm in telling him so in nicer terms. He is > already making the effort to learn.
> Unfortunately, I don't have the answer myself, because I am in a > similar position. I only started reading the Red Book a couple of > weeks ago and my demanding class schedule has kept me from getting > past Chapter 2 so far. But I'm trying.
> As a possible hint to the original poster: I speculate that it > involves getting out of orthographic mode, drawing all that 3D stuff > with OpenGL, getting back into orthographic mode, and then drawing all > the regular stuff the normal pyglet way, with images, etc.
> On Feb 11, 5:11 pm, "Drew Smathers" <drew.smath...@gmail.com> wrote: > > On Feb 11, 2008 4:51 PM, jotham <jotham.r...@gmail.com> wrote:
> > > Well, I guess I should have said. I had a play around before posting > > > here and could not figure out how to do it. Could you provide a > > > simple test case?
> > How about we make a compromise. Try to get it done first on your own by:
> > 1. Learning some OpenGL basics > > 2. Reading the documentation for pyglet
> > If you're still lost, post your broken code and we'll be glad to make > > further suggestions. If you want me to write code for you, that's fine as > > well - just contact me for an estimate (I accept paypal or money orders).
On Feb 11, 2008 5:25 PM, dior...@gmail.com <dior...@gmail.com> wrote:
> You guys are remarkably caustic. I imagine you'll only respond to this > opinion with more of the same, but I thought I'd throw that out there. > If it only takes you thirty seconds to give a quick overview, then why > not? Is it some sort of trade secret? If it's more involved, then > there is certainly no harm in telling him so in nicer terms. He is > already making the effort to learn.
I did feel bad for the sarcasm in my response, but it is the hard truth. If you answer someone's question with working code that solves their problem, then who does that help? No one. First, the person responding has wasted time because the example might not even work in the context of the asker's application. Second, the asker misses an opportunity to learn by doing - through trial and error or other means.
Drew Smathers wrote: > On Feb 11, 2008 5:25 PM, dior...@gmail.com <mailto:dior...@gmail.com> > <dior...@gmail.com <mailto:dior...@gmail.com>> wrote:
> You guys are remarkably caustic. I imagine you'll only respond to this > opinion with more of the same, but I thought I'd throw that out there. > If it only takes you thirty seconds to give a quick overview, then why > not? Is it some sort of trade secret? If it's more involved, then > there is certainly no harm in telling him so in nicer terms. He is > already making the effort to learn.
> I did feel bad for the sarcasm in my response, but it is the hard > truth. If you answer someone's question with working code that solves > their problem, then who does that help? No one. First, the person > responding has wasted time because the example might not even work in > the context of the asker's application. Second, the asker misses an > opportunity to learn by doing - through trial and error or other means.
"Open-ended questions tend to be perceived as open-ended time sinks. Those people most likely to be able to give you a useful answer are also the busiest people (if only because they take on the most work themselves). People like that are allergic to open-ended time sinks, thus they tend to be allergic to open-ended questions."
"To understand the world the experts live in, think of expertise as an abundant resource and time to respond as a scarce one. The less of a time commitment you implicitly ask for, the more likely you are to get an answer from someone really good and really busy."
"Much of what looks like rudeness in hacker circles is not intended to give offense. Rather, it's the product of the direct, cut-through-the-bullshit communications style that is natural to people who are more concerned about solving problems than making others feel warm and fuzzy.
"When you perceive rudeness, try to react calmly. If someone is really acting out, it is very likely a senior person on the list or newsgroup or forum will call him or her on it. If that /doesn't/ happen and you lose your temper, it is likely that the person you lose it at was behaving within the hacker community's norms and /you/ will be considered at fault. This will hurt your chances of getting the information or help you want."
I feel the replies so far have been very reasonable. If Jotham has tried code, he should include it. "If you have some malfunctioning code, it is usually smarter to ask for someone to explain what's wrong with it than it is to ask someone to fix it." Or in this case, ask for someone to rewrite it from scratch. -Luke
def axis(d=200): vertices,colors=[],[] #XZ RED vertices.extend([-d, 0,-d, d, 0,-d, d, 0, d,-d, 0, d]) for i in range (0,4): colors.extend([1,0,0,0.5]) #YZ GREEN vertices.extend([ 0,-d,-d, 0,-d, d, 0, d, d, 0, d,-d]) for i in range (0,4): colors.extend([0,1,0,0.5]) #XY BLUE vertices.extend([-d,-d, 0, d,-d, 0, d, d, 0,-d, d, 0]) for i in range (0,4): colors.extend([0,0,1,0.5]) return x_array(vertices),x_array(colors) AXIS_VERTICES,AXIS_COLORS=axis()
> def axis(d=200):
> vertices,colors=[],[]
> #XZ RED
> vertices.extend([-d, 0,-d, d, 0,-d, d, 0, d,-d, 0, d])
> for i in range (0,4): colors.extend([1,0,0,0.5])
> #YZ GREEN
> vertices.extend([ 0,-d,-d, 0,-d, d, 0, d, d, 0, d,-d])
> for i in range (0,4): colors.extend([0,1,0,0.5])
> #XY BLUE
> vertices.extend([-d,-d, 0, d,-d, 0, d, d, 0,-d, d, 0])
> for i in range (0,4): colors.extend([0,0,1,0.5])
> return x_array(vertices),x_array(colors)
> AXIS_VERTICES,AXIS_COLORS=axis()
jotham wrote: > This project will go far with a community like this.
It's not the community as a whole. There are just a few people who are annoyed when posts such as "I had a play around before posting here and could not figure out how to do it." are not accompanied by said code. All the other people don't care enough to reply. There's no way for us to know what you've tried, and it's not really in either of our interests for us to just hand you boilerplate code that you won't understand fully. So if you give us code that shows where you're stuck we'll try to help. Just asking for a solution is not the right way to go about learning anything.
> I thought my question was pretty specific. Clearly I have a lot to > learn. Other people will ask this question, let it be a lesson to > them.
> Thanks for your help guys.
Don't worry, we picked up on your sarcasm. As I said, your question was specific, but from what we could see, you were just asking someone to give you code. If you show that you've tried (with code) people are much more likely to assist you.
If you begrudge this community for this thread, you will find many others you're at odds with. Programming communities in general frown upon people asking "how do I do x" without proving that they've tried to do x themselves and they are stuck.
> I thought my question was pretty specific. Clearly I have a lot to > learn.Other people will ask this question, let it be a lesson to
them.
Yes, let it be.Your question was very clear. You want to use openGL and you know there is a red book. Why does it not work? Give me a working example.
Really good people is not going to help you, they have better things to do for us, like good libraries and documentation. We don't want them to waste their time.
As opengl newbie, the most difficult part that I saw when I started few weeks ago is to find the geometry that I was trying to draw, so I supposed that you also had problems to understand the projection matrix.
I spend 2 hours to give you a fully working example, where you can find the difference between pyglet's "2D"(sure?) default view and 3D, and the line that you wanted to draw. All the opengl functions you need to know to start working.
Have you ever run the example? --------------------------------
Don't worry, I hope this will help to other people in your position, but really interested in learning. So is it, that I uploaded the code to the web.
> Thanks for your help guys. >> Don't worry, we picked up on your sarcasm.
I did not, damn language lack. I'm a fool, I thought he was serious.
Actually Txema, you were a great help, I thank you for that. The
conversation topics about the nature of helping, your [Txema] direct
help, and my obvious inability to ask questions that please everyone
lead me to believe my sarcasm was and is quite ambiguous.
My primary faults were that I did not understand anything about
pyglets role in the abstraction of OpenGL, and that I did not state I
was looking for an in-pyglet solution rather than getting into the
OpenGL side directly. Being talked down to by people didn't help me
clarify my position though.
I will post in this thread again when I have a clearer understanding
of the outcome and some code to show and be critiqued.
Thank you again guys!
On Feb 13, 11:40 pm, "Txema Vicente" <tx...@nabla.net> wrote:
> Subject: Re: Mixing 2D and 3D> I thought my question was pretty specific. Clearly I have a lot to
> > learn.Other people will ask this question, let it be a lesson to
> them.
> Yes, let it be.Your question was very clear. You want to use openGL and you
> know there is a red book. Why does it not work? Give me a working example.
> Really good people is not going to help you, they have better things to do
> for us, like good libraries and documentation. We don't want them to waste
> their time.
> As opengl newbie, the most difficult part that I saw when I started few
> weeks ago is to find the geometry that I was trying to draw, so I supposed
> that you also had problems to understand the projection matrix.
> I spend 2 hours to give you a fully working example, where you can find the
> difference between pyglet's "2D"(sure?) default view and 3D, and the line
> that you wanted to draw. All the opengl functions you need to know to start
> working.
> Have you ever run the example?
> --------------------------------
> Don't worry, I hope this will help to other people in your position, but
> really interested in learning.
> So is it, that I uploaded the code to the web.
> > Thanks for your help guys.
> >> Don't worry, we picked up on your sarcasm.
> I did not, damn language lack. I'm a fool, I thought he was serious.