Tutorial

3 views
Skip to first unread message

Daniel Aquino

unread,
Aug 20, 2007, 12:44:36 AM8/20/07
to ShatteredRuby
I went through the tut and I kept getting a pink screen that froze...

I also got the error about the mesh on win32 machines which is noted
in the tutorial..

But the downloaded source of the dirty ruby tutorial seemed to give me
an ogre window with all blank values...

I tried to copy the mesh file over but it was to no avail..

Any ideas for me here ?

Mikkel Garcia

unread,
Aug 20, 2007, 2:04:53 AM8/20/07
to shatte...@googlegroups.com
A couple of questions:

  1. Are you on SR 0.5.0.2?
  2. Does the screen freeze before putting the mesh on the screen?
  3. Does pressing escape close the pink window?

We really need to update the tutorials, I'm guessing the demo is for version 0.4 (before the huge ogrerb revamp)

Thanks,
-Mikkel

Daniel Aquino

unread,
Aug 20, 2007, 10:48:53 AM8/20/07
to shatte...@googlegroups.com
> Are you on SR 0.5.0.2?

yes... just installed last night!

> Does the screen freeze before putting the mesh on the screen?

I believe it did but I will get back to you on that one...

> Does pressing escape close the pink window?

Will get back to you...

--------

What about the fact that the downloaded source of the tutorial gave me
an ogre window that didn't offer any selection values ?

Daniel Aquino

unread,
Aug 20, 2007, 10:57:22 AM8/20/07
to shatte...@googlegroups.com
> Does the screen freeze before putting the mesh on the screen?

As I said the screen is frozen.

If I add the mesh then I get the mesh error and no screen ever shows up...

> Does pressing escape close the pink window?

Yes it closes...

Mikkel Garcia

unread,
Aug 20, 2007, 12:46:42 PM8/20/07
to shatte...@googlegroups.com
Thanks for the quick response.

Ogrerb is running correctly (since you can use key :pressed) - could you post the code for the state?


Specifically, I want to see if your near distance, far distance, and camera position / look at are all setup.

BTW, the pink color is set in state by viewport.set_background_colour.  In the next release, I believe we'll change it to a less weird color (maybe ruby red or ogre green).


Thanks,
-Mikkel

Daniel Aquino

unread,
Aug 20, 2007, 2:40:26 PM8/20/07
to shatte...@googlegroups.com
class ObservationState < ShatteredState::Base
key :pressed => :escape, :action => :quit

def initialize
# The different types of scene managers provided by Ogre are:
# :general
# :terrain
# :nature
# :paging
# :indoor
scene_manager = create_scene_manager :general

camera = scene_manager.create_camera("camera")
camera.position = v(0,0,-200)
camera.look_at v(0,0,0)

viewport = create_viewport(camera)
viewport.set_background_colour Ogre::ColourValue.new(0.8, 0.5, 0.5)

# @ruby = DirtyRuby.new
end
end

JeremyW...@gmail.com

unread,
Aug 25, 2007, 11:58:26 PM8/25/07
to ShatteredRuby
I wanted to get in on this post as well. I am also having a bit of
trouble with the tutorial. I can get all the way to the spinning ruby,
but when I press left or right I get an error:

C:\shattered_apps\dirty_ruby>ruby script/runner
c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.0.2/lib/
shattered_view/base.rb
:211:in `translate': No matching function for overloaded
'Node_translate' (Argum
entError)
from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.0.2/lib/
shattered
_view/base.rb:211:in `translate'
from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.0.2/lib/
shattered
_model/base.rb:106:in `send'
from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.0.2/lib/
shattered
_model/base.rb:106:in `method_missing'
from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.0.2/lib/
shattered
_pack/keyboard_input/keyboard_input.rb:88:in `send'
from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.0.2/lib/
shattered
_pack/keyboard_input/keyboard_input.rb:88:in `key_action'
from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.0.2/lib/
shattered
_pack/keyboard_input/keyboard_input.rb:98:in `update_input'
from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.0.2/lib/
shattered
_pack/keyboard_input/keyboard_input.rb:97:in `each'
from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.0.2/lib/
shattered
_pack/keyboard_input/keyboard_input.rb:97:in `update_input'
... 15 levels...
from c:/ruby/lib/ruby/gems/1.8/gems/shattered_ruby-0.5.0.2/lib/
game_load
er.rb:81:in `start_game'
from c:/ruby/lib/ruby/gems/1.8/gems/shattered_ruby-0.5.0.2/lib/
game_load
er.rb:32:in `run'
from ./script/runner.rb:4:in `start_game'
from script/runner:8


My model does contain

class DirtyRuby < ShatteredModel::Base
key :pressed => :left, :action => { :translate => :left }
key :pressed => :right, :action => { :translate => :right }
end


Any ideas?

~Jeremy

Jason Roelofs

unread,
Aug 27, 2007, 3:08:05 PM8/27/07
to shatte...@googlegroups.com
Yeah, the tutorials are quite out of date and what it looks like here is an artifact of trying to use old Shattered Ogre code with the new Ogre.rb backend.

Unless Mikkel and Martyn changed views on keybindings, that code should work, so I would mark that down as a bug. I currently don't have time to look into it myself, but I might be able to later.

Jason


I wanted to get in on this post as well. I am also having a bit of
trouble with the tutorial. I can get all the way to the spinning ruby,
but when I press left or right I get an error:

C:\shattered_apps\dirty_ruby>ruby script/runner

Mikkel Garcia

unread,
Aug 27, 2007, 11:03:00 PM8/27/07
to shatte...@googlegroups.com

Daniel and Jeremy:  gem update shattered_ruby


Version 0.5.1 should address these issues. 

Let me know if it does,

-Mikkel



_pack/keyboard_input/keyboard_input.rb:88:in `key_action'

        from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack- 0.5.0.2/lib/
shattered

JeremyW...@gmail.com

unread,
Aug 28, 2007, 2:25:33 PM8/28/07
to ShatteredRuby
I did the update on my computer here at work. Funny thing actually. My
"spinning ruby" was smaller than this @ symbol. maybe it's just this
computer though. As for the movment issue, still a no go.

C:\rails_apps\dirty_ruby>ruby script/runner
Warning:c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:
importenv
is deprecated after Ruby 1.8.1 (no replacement)
c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.1/lib/shattered_view/
base.rb:2
13:in `translate': No matching function for overloaded
'Node_translate' (Argumen
tError)
from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.1/lib/
shattered_v
iew/base.rb:213:in `translate'
from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.1/lib/


shattered_m
odel/base.rb:106:in `send'

from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.1/lib/


shattered_m
odel/base.rb:106:in `method_missing'

from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.1/lib/


shattered_p
ack/keyboard_input/keyboard_input.rb:88:in `send'

from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.1/lib/


shattered_p
ack/keyboard_input/keyboard_input.rb:88:in `key_action'

from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.1/lib/


shattered_p
ack/keyboard_input/keyboard_input.rb:98:in `update_input'

from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.1/lib/


shattered_p
ack/keyboard_input/keyboard_input.rb:97:in `each'

from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack-0.5.1/lib/


shattered_p
ack/keyboard_input/keyboard_input.rb:97:in `update_input'
... 15 levels...

from c:/ruby/lib/ruby/gems/1.8/gems/shattered_ruby-0.5.1/lib/


game_loader
.rb:81:in `start_game'

from c:/ruby/lib/ruby/gems/1.8/gems/shattered_ruby-0.5.1/lib/


game_loader
.rb:32:in `run'
from ./script/runner.rb:4:in `start_game'
from script/runner:8

it's just when I press the left or right key when this happens.

thanks for the help with this.


~Jeremy

On Aug 27, 8:03 pm, "Mikkel Garcia" <lekkim.gar...@gmail.com> wrote:
> Daniel and Jeremy: gem update shattered_ruby
>
> Version 0.5.1 should address these issues.
>
> Let me know if it does,
>
> -Mikkel
>

> On 8/27/07, Jason Roelofs <jameskil...@gmail.com> wrote:
>
>
>
> > Yeah, the tutorials are quite out of date and what it looks like here is
> > an artifact of trying to use old Shattered Ogre code with the new Ogre.rbbackend.
>
> > Unless Mikkel and Martyn changed views on keybindings, that code should
> > work, so I would mark that down as a bug. I currently don't have time to
> > look into it myself, but I might be able to later.
>
> > Jason
>

> > On 8/25/07, JeremyWoert...@gmail.com <JeremyWoert...@gmail.com > wrote:
>
> > > I wanted to get in on this post as well. I am also having a bit of
> > > trouble with the tutorial. I can get all the way to the spinning ruby,
> > > but when I press left or right I get an error:
>
> > > C:\shattered_apps\dirty_ruby>ruby script/runner
> > > c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack- 0.5.0.2/lib/
> > > shattered_view/base.rb
> > > :211:in `translate': No matching function for overloaded
> > > 'Node_translate' (Argum
> > > entError)
> > > from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack- 0.5.0.2/lib/
> > > shattered
> > > _view/base.rb:211:in `translate'

Mikkel Garcia

unread,
Aug 28, 2007, 7:42:45 PM8/28/07
to shatte...@googlegroups.com
Heh, I seriously thought I fixed this - ah well, another bug for trac.

You may want to regenerate the state(s).  The generated code has been cleaned up drastically.
After that, changing the position of the camera to be closer to the ruby should work:

From:
  camera :position => :z*300, :look_at => :zero
To:
  camera :position => :z*50, :look_at => :zero


also, to (temporarily) fix your error with the translate:

class DirtyRuby < ShatteredModel::Base
 key :pressed => :left, :action => { :move => :left }
 key :pressed => :right, :action => { :move => :right }

  def move(direction)
    translate(direction.to_v)
  end
end

Thanks for pointing out the error!
-Mikkel

> > > _pack/keyboard_input/keyboard_input.rb:88:in `key_action'

> > >         from c:/ruby/lib/ruby/gems/1.8/gems/shattered_pack- 0.5.0.2/lib/
> > > shattered
> > > _pack/keyboard_input/keyboard_input.rb:98:in `update_input'

JeremyW...@gmail.com

unread,
Aug 28, 2007, 8:47:16 PM8/28/07
to ShatteredRuby
OMG! You rock! it worked. this stuff gives me a <%=
insert_favorite_noun_here %> .

So, now that I can get it to work, I want to know what it is i'm
doing. You said adding the method to the DirtyRuby model was a
temporary fix, so what does the .to_v method do exactly? Or I guess,
what does the "v" stand for, since I already know that it's converting
the object in a fashionable ruby manor :)


~Jeremy


On Aug 28, 4:42 pm, "Mikkel Garcia" <lekkim.gar...@gmail.com> wrote:
> Heh, I seriously thought I fixed this - ah well, another bug for trac.
>
> You may want to regenerate the state(s). The generated code has been
> cleaned up drastically.
> After that, changing the position of the camera to be closer to the ruby
> should work:
>
> From:
> camera :position => :z*300, :look_at => :zero
> To:
> camera :position => :z*50, :look_at => :zero
>
> also, to (temporarily) fix your error with the translate:
>
> class DirtyRuby < ShatteredModel::Base
> key :pressed => :left, :action => { :move => :left }
> key :pressed => :right, :action => { :move => :right }
>
> def move(direction)
> translate(direction.to_v)
> end
> end
>
> Thanks for pointing out the error!
> -Mikkel
>

Mikkel Garcia

unread,
Aug 28, 2007, 10:09:34 PM8/28/07
to shatte...@googlegroups.com
zero.to_v == Ogre::Vector3.new(0,0,0) == v(0,0,0)

Just different ways to display the same things.

It's a temporary fix, because translate(:left) should work fine.

-Mikkel

def insert_favorite_noun_here
  "*** censored***"
end

JeremyW...@gmail.com

unread,
Aug 28, 2007, 11:09:37 PM8/28/07
to ShatteredRuby
haha, right on. awesome.


~Jeremy

On Aug 28, 7:09 pm, "Mikkel Garcia" <lekkim.gar...@gmail.com> wrote:
> zero.to_v == Ogre::Vector3.new(0,0,0) == v(0,0,0)
>
> Just different ways to display the same things.
>
> It's a temporary fix, because translate(:left) should work fine.
>
> -Mikkel
>
> def insert_favorite_noun_here
> "*** censored***"
> end
>

Reply all
Reply to author
Forward
0 new messages