Very nice! Love how dynamic the dialogs are. How did you do the html layout? Any java script libs used?
Posts
-
RE: Web Dialogs and SkIndigo - made for each other...
-
RE: Why is this model not working?
@spacecow said:
I restarted my computer and the file wouldn't work again (the ruby console showed nothing either). So I copy and pasted the track into Untitled.skp and it works fine. Except the ball floated off the track, haha.
Oh, I see the problem now. Thanks cdauscher
Your model is really big and its a little bit outside the world. Use the primitives tool bar to add a "floor". Then move your model down closer to it. Dont try to scale your model. It will probably just confuse SketchyPhysics.
-
RE: Why is this model not working?
@spacecow said:
Hey guys, I'm making a marbles track and can't figure out why SP doesn't do anything when I click "Play." Even if you try to drag something, it won't do so. I checked the in-program settings and gravity is fine, though I set it to 8 afterwards in hopes that it would work
Can someone help me? File attached.
It works fine for me. Try this: Open the ruby console (Window->Ruby Console) and press play again. It will probably show some sort of error. Copy and paste that into a reply here.
-
SUWiki?
Is SUWiki.org still operational? I was thinking about creating some new pages but I can't seem to find a way to create a new account.
-
RE: The colour of a sphere
@alr said:
Merry Christmas!
How I can assign a color (material) to sphere?
I know this variant:
circle1 = entities.add_circle([0, 0, 0],[0,0,1],15,24)
circle2 = entities.add_circle([15,0, 0],[1,0,0],15,24)
face = entities.add_face(circle1)
face.material="yellow"
face.followme(circle2)
entities.erase_entities circle2It works, but I would like to avoid the line <face.material="yellow">
and assign the material not to face but to the sphere shape as a whole after followme action.Is it possible?
That is probably the simplest way to wind up with a yellow sphere. Maybe what you want is to group the faces that makeup the sphere and then set the material on the group? If so add_group to entities and build the sphere in that group. Then do group.material="yellow".
-
RE: Tutorials....
@deano40 said:
hey cool , I made that tutorial ,glad it helped
Thanks Deano! I have pointed a lot of users at that tutorial.
-
RE: Initiating Sketchyphysics causes Bugsplat
@loafin andy said:
No crashes without joints, but I have tested with some simple models from the warehouse and get splatted each time?
Very interesting.
First make sure you are using the right version. It should be the one from this page: http://code.google.com/p/sketchyphysics/downloads/list Dated July 7.Another possiblility, Are you loading the 3dwarehouse models directly into Sketchup via "File->3dwarehouse->Get Models". If so that might be the problem. Try downloading the files with a browser and then open in Sketchup.
If that is not the problem then I dunno... Whats your OS? Videocard? Do you have Sketchup installed in an unusual location.
Chris
-
RE: Initiating Sketchyphysics causes Bugsplat
If you are not using joints right it could cause a crash. Does a model without joints cause a bugsplat?
-
RE: Initiating Sketchyphysics causes Bugsplat
@loafin andy said:
Every time I initiate Sketchyphysics to play even a simple cog set up SU crashes and Bugsplats me. Any ideas as to what may be causing it. I've tried reinstalling it and it is the latest update, so I'm stumpped.
Hmm. Does even a model with just a shape or two crash? Or is it just when using joints?
Chris
-
RE: Detecting a flipped transform.
@adamb said:
OK, I think I can help. First off, don't get hung up on the flipped thing. Its not a 'magic' operation - how many times have I multiplied the following number by -1?
123
You can't know. An even number of multiplies (aka flips) gets you back to where you started. Its the same with multiplying an axis.
OK, some background. The basic building block of almost all this stuff is dot product. Dot product is actually projecting 1 vector onto another to see how far along it lies. The transforms in SU are made of 4 things. An xaxis, yaxis, zaxis and a position stored in a Geom::Transformation. When you do "object.transform aMatrix" what you're actually doing is calculating how far along those 3 axes "object" lies. If you look at a vector matrix multiply it is composed of 3 dot products because all you're doing is projecting the vector onto those 3 axes in turn to give 3 numbers to make your 3d coordinate. (Its very simple but I'm amazed the number of engineers I've interviewed for jobs that haven't understood this!)
The scale of an SU transform is in the axis,yaxis,zaxis of the Transformation. So, the length of the xaxis,yaxis and zaxis tell you much scaling there is in each direction.
object.transformation.to_a[0..2] is the xaxis
object.transformation.to_a[4..6] is the yaxis
object.transformation.to_a[8..10] is the zaxis(Rather unhelpfully if you do object.transformation.xaxis you get a unit length vector..)
A normal matrix has axes of unit length (aka no scaling)
An orthogonal matrix has axes at right-angles to each other.
A orthonormal matrix is both unit length AND at right-angles.Physics systems often want orthonormal matrices. This means you'll need to record the length of each axis then normalize followed by ensuring its orthogonal by ensuring z = x * y and x = y * z
A note on crossproduct
a * b gives a vector perpendicular to a and b and of length absin(theta) where theta is the angle between a & b. What this means is if a and b are unit length but NOT perpendicular, you'll get a vector that is not unit length and it needs re-normalizing.
You can see that Orthonormalization of matrices is expensive but the quality of your results depends on it.
There's something to be going on...
Adam
Thanks Adam! I am taking a fresh look at my code and I think I am beginning to understand.
Chris
-
RE: Detecting a flipped transform.
@adamb said:
Ah but if you 'flip' in blue and then green the object isn't flipped! You've performed a 180 around x. The math is telling the truth.. The cross product of the axes will give you the handedness of the coordinate system. Sounds like you almost want some kind of history of what happened - thats something the coordinate frame cannot give you.
Stepping back.. What are you trying to do? Is it face winding order you want? ie Whats 'front' and whats 'back'?
Adam
This is for my SketchyPhysics plugin. It uses the Newton physics engine and it expects its transforms to be without scale. So I am trying to produce a reliable way to convert SU objects with scaled transforms to Newton objects without.
I have figured out how to pull simple scale out of a SU transform by transforming 3 unit vectors and then checking the length. But flipped objects have eluded me. Probably because I don't fully understand whats going on when something is "flipped".
Are you saying that once an transform has been flipped more than once you cant be sure what axis it has been flipped around?
-
RE: Ignoring grouped objects
@unknownuser said:
That does make the edge fly straight through stuff, but it still outweighs the box. I think the problem might be that when I group them, the group that they are in has weight to it even though it has no geometry directly inside it. If this is the problem I have no idea how to fix it.
Congratulations, You found a bug. It looks like the center of gravity is at the center of the object even tho part of it is set to ignore. I am surprised no one has found this before. Ill fix in the next release.
Chris
-
RE: Ignoring grouped objects
@unknownuser said:
Here's an example. What I want to happen is the edge (I want it weightless) gets whipped around by the box, not visa-versa.
Ah, you need to make the box and the line 2 separate groups. Make the line its own group, flag it as ignore and then group with the box.
Chris
-
RE: Ignoring grouped objects
@unknownuser said:
So here I am making something with sketchy physics and I cant figure out how to make something be ignored (so that it has no weight and does not collide) while grouped to some active things , not even a simple edge. This seems very weird but when I have several grouped objects and then add a simple edge to them, the edge passes straight through stuff but has some incredible weight for something mathematically thin! even if I try to make the only group it is in ignored.
I am not sure I understand. Could you post an example?
Chris
-
RE: Detecting a flipped transform.
Hmm. You sure sound convincing. Let me test it out tonight and see if I can make it work. If not Ill post an example.
Thanks
Chris -
RE: Detecting a flipped transform.
@adamb said:
Sketchup uses a righthanded coordinate system. Flipping (scale by -1) of an axis makes it like a lefthanded system, so why don't you just check that xaxis * yaxis == zaxis and yaxis * zaxis == xaxis. In fact you're only interested in the sign so (xaxis * yaxis).dot(zaxis) < 0 means its flipped.
Ah! That is the sort of thing I am looking for. But it only works to a point. If I flip blue and then green it says the object isnt flipped. Also how can I tell which axis it is flipped around?
Thanks for the help Adam. I am a bit weak in 3d math.
Chris
-
RE: Using default sketchup materials with Ruby API
I dont know if this is your problem or not but...
I found a bug a while back where if I tried to apply a material with a texture that wasn't already in the model it would to unpredictable things including crash. Try adding that material to something by hand before you try to assign in using ruby.
Chris
@mocathe1st said:
I think I'm missing something in the docs, but can anyone tell me how to assign default sketchup materials to faces? The docs seem to be for Sketchup 4 and talks about .jpg files.
I tried the following code but it just changes the material to black:
materials = Sketchup.active_model.materials> m = materials.add "opening" > m.texture="c;\\Program Files\\@Last Software\\Google SketchUp 6\\Materials\\Translucent\\Translucent_Glass_Sky_Reflection.skm" > face.material = m >
Any help would be great.
Thanks.
-
RE: Detecting a flipped transform.
@unknownuser said:
> t = transformation.to_a > p t[0] < 0 # flipped on red? > p t[5] < 0 # flipped on green? > p t[9] < 0 # flipped on blue? >
I wish it was that easy. But it only works if the object hasn't been rotated.
Select something:
Sketchup.active_model.selection[0].transformation.to_a[0] #get red flip. Pos value.
Flip selection along red.
Sketchup.active_model.selection[0].transformation.to_a[0] #works. value is neg
Now rotate selection 180 around blue
Sketchup.active_model.selection[0].transformation.to_a[0] #fails. value is pos.Unless I am missing something?
Chris -
Detecting a flipped transform.
I need to be able to tell if an object has been flipped and in what direction. As far as I can tell SU flips an object by scaling the transform. But I can't for the life of me figure out how to separate it from rotation/scaling etc.
Anyone figure this out yet?
Chris
-
Amazing car.
This is one of the most ambitious projects I have seen.
Props to martinchopablo. I'll chip in to help you buy a faster computer.