sketchucation logo sketchucation
    • Login
    1. Home
    2. renderiza
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 98
    • Posts 783
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: Making a SketchUp game named "Resballiza"

      Hi,

      Here is a video update about the progress of the game so far;

      I need to find an alternative solution for playing sound effects since the Sketchup "UI.play_sound" can't seem to handle simultaneous sounds to overlay each other.

      The current script is based on Scott Lininger's "Prince IO" but a lot of things are different. For example the collision is base on a javascript code to compare distances and not sketchup raytrace.

      If you want to test the current alpha version of the game you can download it here for testing.

      Dropbox - No Access - Simplify your life

      favicon

      (www.dropbox.com)

      Thanks

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Making a SketchUp game named "Resballiza"

      Current issue at hand…

      In the code bellow the references have to be “$” (constant) or else the script won’t work.

      1st Problem
      I have tried to use “@”& “@@” but it doesn’t seem to work… I should not use a constant as reference but right now I am lost in how to not use them.

      2nd Problem
      When using this following code:

      … This code is similar to the one been used by the following here;
      http://forums.sketchucation.com/viewtopic.php?f=180&t=25498#p218970

      module Renderiza
      
      	module Resballiza
      
      		class SuGame
      
      			$x ||= 600
      			$z ||= 800	
      					
      			if $z <=> 800
      				$z = $z - 100
      			end
      						
      			if $z <= -200
      				$z = 800
      				$x = rand(600)
      			end
      
      			def nextFrame( view )
      			  $ball.move! $t                                                           #<<<---- using the move! there
      				return ( Time.now() - $start ) <3
      			end
      		   
      			def stop()
      				puts 'emptying trash'
      
      			end
      
      			$ball = Sketchup.active_model.selection[0]
      			@move = Geom;;Vector3d.new($x,0,$z)
      			$t = Geom;;Transformation.translation(@move)
      			$start = Time.now()
      
      		end # of class SuGame
      
      			view = Sketchup.active_model().active_view()
      
      			view.animation = SuGame.new
      
      		end #module Resballiza
      
      end #module Renderiza
      

      Continuation of problem #2…

      When the animation is started the object is position doesn’t travel down like it should with only one click. I still have to keep clicking the ‘exec’ button for it to move.

      There is something about this “move!” method because if you replace that with “transform!” like it was originally written by the other guys then the object is position changes over time. But there has to be something that will still enable me to use the move! method because I really like that it uses the global axis of sketchup instead of the local axis of the object the transform! uses.

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Random move components?

      Hi thanks for the code sniped 👍

      I learned how to ask for a random coordinate.

      I am kind of using a variation of this but with the method “move!” for a game I am trying to make. Here is the thread… http://forums.sketchucation.com/viewtopic.php?f=180&t=48043

      posted in Plugins
      renderizaR
      renderiza
    • RE: [Code] !autoload.rb loads &quot;!_autoload&quot; folders - v3.0.0

      This is very useful information…Thanks!

      Question…

      Is the “.rb” extension really necessary when using for example “require (“sketchup.rb”)?

      Can it just be “require (“sketchup”)?

      Again Thanks

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Info about add_note method

      Can the text and the position of this note be animated?
      For example can I make a timer with this?

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Making a SketchUp game named &quot;Resballiza&quot;

      Problem fixed!

      I now don’t have to delete any line of code after I hit the “exec” button for the script to work. Let me explain how this issue on the last code I posted was fixed. I was looking through the code Dan Rathbun posted in the following link.

      http://forums.sketchucation.com/viewtopic.php?f=180&t=48045

      I was asking myself why he uses this “||” in “@@duration ||= 15” for example and decided to put “||” in my own code. For some “magical” reason the script now works.

      Here is the new code:

      # This file attepts to move an object down and when it reachea a certain distance it resets.
      
      require('sketchup.rb')
      
      #=============================================================
      
      module Renderiza
      	#
      	#
      	module Resballiza 
      		#
      		
      		#
      		class MyGame
      			#
      			#
      			@@x ||= 600
      			@@z ||= 800	
      		
      			if @@z <= 800
      				@@z = @@z - 100
      			end
      			
      			if @@z <= -200
      				@@z = 800
      				@@x = rand(600)
      			end
      			
      			
      			@ball = Sketchup.active_model.selection
      			@move = Geom;;Vector3d.new(@@x,0,@@z)
      			#
      			#
      			@ball.each do 
      			|ball| ball.move!(Geom;;Transformation.translation(@move)) 	
      			end #do
      			#
      			#
      		end #class MyGame
      		#
      		window = MyGame.new #If this is not here the above script won't work.
      		#	
      	end #module Resballiza
      	#
      	#		
      end # module Renderiza
      

      Also the object is Xaxis randomly generates every time it resets. Now I can move to the next step which is to animate the object without having to keep clicking the “exec” button.

      Wish me luck!

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Making a SketchUp game named &quot;Resballiza&quot;

      The link is fixed....thanks for letting me know. 👍

      Just drop the files inside a folder and done.

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Making a SketchUp game named &quot;Resballiza&quot;

      @unknownuser said:

      Black Ball can't move over the horizontal middle line ?

      The ball can move freely all over the screen (even above the middle line)...There is a Resballiza.exe that runs without install, you can try it yourself with this following link.
      http://www.dropbox.com/sh/b9wp4fnvisd0qyd/-D3fdDBkZW

      Thanks

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Making a SketchUp game named &quot;Resballiza&quot;

      transform! Vs move!

      The method “move!” seems to behave similar to how the objects move in “Resballiza” with the “gosu” extension for ruby. It uses a global axis as reference for the (x,y,z) coordinates of the object while the Method “transform!” seems to use the local axis of that entity.  
      
      I kind of figured out how to reset the position of an object when the Zaxis reaches a certain point using the method “move!” with the following code… 
      
      # This file attepts to move an object down and when it reachea a certain distance it resets.
      
      require('sketchup.rb')
      
      #=============================================================
      
      module Game
      	#
      	#
      	module Resballiza 
      		#
      		#
      		class MyGame
      			#
      			#
      			def inicializa ()
      				@x = 600
      				@z = 800
      			end
      			#
      			#--------------------------------------------------------
      			@x = 600 #Delete this after 1st exec hit for ball to move	
      			@z = 800 #Delete this after 1st exec hit for ball to move
      			#--------------------------------------------------------
      			#
      			@ball = Sketchup.active_model.selection
      			@move = Geom;;Vector3d.new(@x,0,@z)
      			#
      			#
      			@ball.each do 
      			|ball| ball.move!(Geom;;Transformation.translation(@move)) 
      				#
      				#
      				if @z <= 800
      					@z = @z - 50
      				end #if
      				#
      				#
      				if @z <= -200
      					@z = 800
      					@x = rand(600)
      				end #if
      				#
      				#
      			end #do
      			#
      			#
      		end #class MyGame
      		#
      		window = MyGame.new #If this is not here the above script won't work.
      		#	
      	end #module Resballiza
      	#
      	#		
      end # module Game
      
      

      The code doesn’t run smoothly inside “Sketchup” because ones you hit “exec” in the Web Console for the first time, you have to delete the code line that says “#Delete this after 1st exec hit for ball to move”. Once that is done you need to keep hitting “exec” for object to keep falling until it resets. I wish I can figure out how to solve this so I can move to the next step.

      Thanks

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: [Code] AnimateSelection Example v1.0.1

      Thank you

      I will study this code very carefully so I can learn how to make changes if needed to accomplish what I want.

      posted in Developers' Forum
      renderizaR
      renderiza
    • Making a SketchUp game named &quot;Resballiza&quot;

      Hi,

      This Thread is meant to document my progress in learning ruby inside sketchup while trying to make a simple game. So any questions or discoveries will be posted here.

      Before venturing in trying to figure out how to make a game inside sketchup, I started one called “Resballiza” with ruby and Gosu. The progress of that task was successful and more info can be found here: Resballiza info and Video Preview

      My future goal is to try and replicate “Resballiza” inside sketchup.

      Wish me luck! 👍


      Here is a game I am developing for SketchUp

      Video Update #1
      http://www.youtube.com/watch?v=xFrD7ORH4X0&feature=plcp

      Video Update #2
      http://www.youtube.com/watch?v=JuM2qtBy7bs&feature=plcp


      Video Update #3

      To download the latest SketchUp game version go here;
      https://www.dropbox.com/sh/w9m7du0fnhkgwv0/bIqndmMs1S

      Thanks

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: New API doc - typos and questions

      Thanks Dan Rathbun for teaching me how to debug inside Ruby Console.
      I forgor to post the topic link I was referring to…
      http://forums.sketchucation.com/viewtopic.php?f=180&t=25498

      I still can’t find a way to load the jumper.rb and animate the object when active but I will sonn figure it out. And I promise that for next time I will make a new topic for my issues. 👍

      Thanks

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: New API doc - typos and questions

      Hi,

      Thanks TIG for explaining that

      I found this topic and it solves animating an object like I wanted to but I can't make a file.rb for leading in the plugins menu. It shows me this error;

      Load Errors
      Undefined method ‘transform!’ for nil:NilClassError Loading File
      jumper.rb
      undefined method ‘transform!’ for nil: NilClass

      If anyone nows how to solve this let me know

      Thanks

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Help with Animation

      @chris fullmer said:

      Here is a quick animation showing your code in action (no sound):

      [flash=1004,675:rhvt88ob]http://chrisfullmer.com/forums/martin_jumper.swf[/flash:rhvt88ob]

      Hi,

      The code runs while using the “Ruby Web Console” but when I try to make a jumper.rb out of it to put it on the plugins folder the following error shows;

      Load Errors
      Undefined method ‘transform!’ for nil:NilClassError Loading File
      jumper.rb
      undefined method ‘transform!’ for nil: NilClass

      If I try to put the following;

      def transform
      $gc = Sketchup.active_model.selection[0]
      vec = Geom;;Vector3d.new(0,0,1)
      $t = Geom;;Transformation.new(vec)
      $start = Time.now()
      
      view = Sketchup.active_model().active_view()
      
      view.animation = Jumper.new
      end
      

      The jumper.rb loads ok but when I press it no animations are triggered. Can someone please help me with this.

      Thanks

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: New API doc - typos and questions

      @thomthom said:

      Animation
      http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/animation.html

      The first example on that page:

      
      >      # This is an example of a simple animation that floats the camera up to
      >      # a z position of 200". The only required method for an animation is
      >      # nextFrame. It is called whenever you need to show the next frame of
      >      # the animation. If nextFrame returns false, the animation will stop.
      >      class FloatUpAnimation
      >        def nextFrame(view)
      >          new_eye = view.camera.eye
      >          new_eye.z = new_eye.z + 1.0
      >          view.camera.set(new_eye, view.camera.target, view.camera.up)
      >          view.show_frame
      >          return new_eye.z < 500.0
      >        end
      >      end
      > 
      >      # This adds an item to the Camera menu to activate our custom animation.
      >      UI.menu("Camera").add_item("Run Float Up Animation") {
      >        Sketchup.active_model.active_view.animation = FloatUpAnimation.new
      >      } 
      > 
      

      It makes a class named FloatUpAnimation, but no mention of Animation. A bit confusing.
      Is it like the Observers?
      Should it say class FloatUpAnimation < Animation

      Hi,

      Can someone post an example of using the "nextFrame(view)" definition for moving an entity object instead of a camara?

      My objective is to create a game in SketchUp similar to the one I am making with ruby and gosu named "Resballiza" ... Here is a link for more info;

      404 Not Found

      favicon

      (www.libgosu.org)

      So far I have studied JS Move Tool by Jan Sandstrom and changed the Keys for my game style but the "Typematic effects" bug in windows is giving me a hard time.
      I have also tried to understand the scrip in the "Prince of IO" game but get lost with anything that has to do with Webdialog related scripts. Please any help in demonstrating a simple object animation that is as simple as the FloatUpAnimation scrip for the camera let me know.

      Thanks

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: OnKeyDown repeat parameter problem

      @dan rathbun said:

      @mtalbott said:

      Any ideas on how to break the onKeyDown loop when a key is released?
      -Mike
      Perhaps:

      (1) Try executing the onKeyDown loop in a subthread, so that the main thread can still 'trap' the onKeyUp event. You would probably need your Tool to have an boolean instance var, like @mykeydown, set to true by the onKeyDown event callback method, BEFORE you go into the loop; and for example the loop condition might be:
      while @mykeydown do ...[code]... end
      ..then the onKeyUp event callback method would set @mykeydown=false, and the loop should exit on the next pass.
      The big trickis that you need the call to yourTool.onKeyDown to return (while still running the loop in a sub-thread,) so Sketchup can do other things, including redraw the UI, and watch for the release of the keys, so it can call the yourTool.onKeyUp method.

      Can someone explain this with an example code so I can understand better. What is a subthread? I can't figure out how to solve this "Typematic effects" bug in windows. Please Help

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: [WIP] house in Helsingborg Sweden

      Hi,
      I really like that you added the background trees, they look really nice. A foreground element would have been nice as well for capturing more depth. The subtle dirt detail in the wall texture makes a huge improvement in the look of the render. Placing the building off center like you did in the first image in my opinion makes the whole composition look a lot better. Overall nice renders!

      Oh, and nice grass also… 👍

      posted in WIP
      renderizaR
      renderiza
    • RE: [Plugin] Plugin Loader for SketchUp

      Thank you very much!

      Before this plugin I had to close & reopen my skecthup to review the changes I made to my ruby script but now I can just reload it right inside the program.

      posted in Plugins
      renderizaR
      renderiza
    • RE: [ruby request\question]nesting visibility toggle

      Giving that the solution towards hiding everything except the flea interferes with “Hide Rest of Model”, could the solution possibly be to find a way in temporarily copy & “pasting in place” the “flea” outside of the current group you’re going to hide automatically with a script?

      That way the process of hiding the group without the wanted subgroup will be faked. But I bet that will take the fun out in figuring out how to not fake the process. 😉

      posted in Plugins
      renderizaR
      renderiza
    • RE: Poser to sketchup?

      Artisan plugin has a tool to reduce polygons but the texture will get screwed. So you will have to make new UV’s. I believe TGI 3D plugin has a tool to make UV’s but don’t know if it will tackle a complex geometry properly.
      Good luck!

      posted in SketchUp Discussions
      renderizaR
      renderiza
    • 1 / 1