Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #36365
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <vincent.vandevyvre@swing.be> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'elif': 0.04; 'modified': 0.05; 'url:launchpad': 0.05; '(0,': 0.09; '0.1': 0.09; 'pressing': 0.09; 'segfault.': 0.09; 'unpacking': 0.09; 'def': 0.10; '0):': 0.16; '0.001': 0.16; 'accelerates': 0.16; 'angle': 0.16; 'crashes': 0.16; 'from:addr:swing.be': 0.16; 'from:addr:vincent.vandevyvre': 0.16; 'from:name:vincent vande vyvre': 0.16; 'message-id:@swing.be': 0.16; 'oqapy': 0.16; 'paqager': 0.16; 'received:mobistar.be': 0.16; 'url:oqapy': 0.16; 'url:paqager': 0.16; 'url:qarte': 0.16; 'v.v.': 0.16; '\xe9crit': 0.16; 'changes': 0.20; 'subject:problem': 0.22; 'work.': 0.23; 'seems': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'reset': 0.29; "skip:' 10": 0.30; 'up.': 0.31; 'code': 0.31; 'skip:- 30': 0.31; 'skip:- 10': 0.32; 'problem': 0.33; 'to:addr:python-list': 0.33; 'code:': 0.33; 'another': 0.33; "can't": 0.34; '2.0': 0.35; 'direction': 0.35; 'false': 0.35; 'but': 0.36; 'subject:with': 0.36; 'itself': 0.37; 'keeps': 0.37; 'does': 0.37; 'skip:v 20': 0.37; 'subject:: ': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'skip:u 10': 0.60; 'fuel': 0.65; 'received:80.12': 0.65; 'moves': 0.84; 'p.s': 0.84; 'email addr:hotmail.com': 0.88 |
| Date | Mon, 07 Jan 2013 18:40:26 +0100 |
| From | Vincent Vande Vyvre <vincent.vandevyvre@swing.be> |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: problem with exam task for college |
| References | <6f3c7fdf-7439-43b1-b3a2-da9da019b1ec@googlegroups.com> <9d4db036-b840-4c2e-8cfb-edc2afb7bbaa@googlegroups.com> |
| In-Reply-To | <9d4db036-b840-4c2e-8cfb-edc2afb7bbaa@googlegroups.com> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | 8bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.229.1357580886.2939.python-list@python.org> (permalink) |
| Lines | 70 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1357580886 news.xs4all.nl 6883 [2001:888:2000:d::a6]:57837 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:36365 |
Show key headers only | View raw
Le 07/01/13 17:22, jeltedeproft@hotmail.com a écrit :
> ok after another round of reparations, my update works again and it updates the fuel meter, but i still can't get the view of the spaceship to rotate, for now only the direction the spaceship accelerates when pressing "up" changes after a rotation, but the spaceship itself keeps pointing up. This is the code for the rotating : p.s : the problem has to be in this code because the update of the view of the position of the spaceship does work.
>
>
> def update(self,dt):
> self.velocity = self.velocity + (self.acceleration * dt)
> self.pos = self.pos + self.velocity * dt
> a = 0
> b = 0
> if scene.kb.keys:
> a = a + 0.001
> s = scene.kb.getkey()
> if (s == "up"):
> if self.zicht.meter.height != 0:
> self.velocity = self.velocity + self.gas
> self.vlam.visible = True
> b = b + 2
> self.zicht.meter.height = self.zicht.meter.height - 0.1
> self.zicht.update
> if (s == "left"):
> self.gas = rotate(self.gas,angle = math.pi/10, axis = (0,0,1))
> (x,y,z) = self.frame.axis
> self.frame.axis = (x,y,z-0.1)
> if (s == "right") :
> self.gas = rotate(self.gas,angle = -(math.pi/10), axis = (0,0,1))
> (x,y,z) = self.frame.axis
> self.frame.axis = (x,y,z+0.1)
> if (a == 0):
> self.vlam.visible = False
Are you sure with this code:
(x,y,z) = self.frame.axis ?
frame.axis is a 'cvisual.vector' and this unpacking cause a program
crashes with a segfault.
For left-rigth moves of the LEM, this code seems works:
--------------------------------------
if scene.kb.keys:
key = scene.kb.getkey()
if key == "left":
# Set left deviation
self.frame.axis -= (0, 0, 0.05)
self.gas = vector(-sin(self.angle), cos(self.angle))
elif key == "right":
# Set right deviation
self.frame.axis += (0, 0, 0.05)
self.gas = vector(sin(self.angle), cos(self.angle))
elif key == "up":
self.deviate()
def deviate(self):
# Set modified velocity
self.frame.velocity += self.gas
self.frame.pos += self.frame.velocity
# Reset falling velocity
self.frame.velocity -= self.gas
--------------------------------------
with angle = PI / 2.0
--
Vincent V.V.
Oqapy <https://launchpad.net/oqapy> . Qarte
<https://launchpad.net/qarte> . PaQager <https://launchpad.net/paqager>
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
problem with exam task for college jeltedeproft@hotmail.com - 2013-01-04 10:23 -0800
Re: problem with exam task for college Chris Angelico <rosuav@gmail.com> - 2013-01-05 05:59 +1100
Re: problem with exam task for college Chris Angelico <rosuav@gmail.com> - 2013-01-05 06:00 +1100
Re: problem with exam task for college MRAB <python@mrabarnett.plus.com> - 2013-01-04 19:17 +0000
Re: problem with exam task for college Joshua Landau <joshua.landau.ws@gmail.com> - 2013-01-04 19:18 +0000
Re: problem with exam task for college Chris Angelico <rosuav@gmail.com> - 2013-01-05 06:30 +1100
Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-04 12:01 -0800
Re: problem with exam task for college Chris Angelico <rosuav@gmail.com> - 2013-01-05 07:36 +1100
Re: problem with exam task for college Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-05 16:09 -0500
Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-04 12:01 -0800
Re: problem with exam task for college Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-04 17:11 -0500
Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-05 04:24 -0800
Re: problem with exam task for college Chris Angelico <rosuav@gmail.com> - 2013-01-05 23:39 +1100
Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-05 05:14 -0800
Re: problem with exam task for college Chris Angelico <rosuav@gmail.com> - 2013-01-06 00:32 +1100
Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-07 08:22 -0800
Re: problem with exam task for college Vincent Vande Vyvre <vincent.vandevyvre@swing.be> - 2013-01-07 18:40 +0100
Re: problem with exam task for college Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-07 15:36 -0500
Re: problem with exam task for college jeltedeproft_8@hotmail.com - 2013-01-13 04:29 -0800
Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-13 04:48 -0800
Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-13 05:57 -0800
Re: problem with exam task for college Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-01-13 17:28 +0000
Re: problem with exam task for college stefaang@gmail.com - 2013-01-14 04:57 -0800
Re: problem with exam task for college jeltedeproft@hotmail.com - 2013-01-14 08:01 -0800
Re: problem with exam task for college Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-01-14 13:54 -0500
csiph-web