FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Suggestions
   Software Suggestions
(Moderator: fry)
   Vector - General Matrix Transformations
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: Vector - General Matrix Transformations  (Read 1124 times)
gll

WWW Email
Vector - General Matrix Transformations
« on: Apr 29th, 2004, 10:30am »

http://www.vif.com/users/goo/P55/StairKnot/index.html
 
I was working with the Vec3D class. I'm familiar with POVray. Maybe it could a great thing to have generic Matrix transformation working with Push() and pop(). It will be easier to do complex transformations (shear,spherize,bend).
 
Working with vector hard to read. In POVray, you simply do this (vector A*B) and it's done. I was trying to find a way to ovewrite the operator (+ - * /) but it's not allowed in JAVA, isn't it? Any proposition?
 
In this example, I made a code to find the perpendicular plane of an arbritrary path. I used Frenet Frame algorithms.
 
I planning to make intensive use of the Vectors. I'm wandering if there's a lot of people familiar with POVray here?
 

guillaume LaBelle
TomC

WWW
Re: Vector - General Matrix Transformations
« Reply #1 on: Apr 29th, 2004, 11:13am »

Yes, you're right, you can't overload the operators in Java.  I think there are extensions to do so, and I suppose they could be rolled into processing, but I wouldn't hold your breath for anyone to work out how
 
The StairKnot looks totally awesome... have you looked at Simon Greenwold's DXF output to enable you to produce rendered versions?  Seems ideal for your kind of work.
 
Also, can I ask how you did the syntax highlighting in your PDF source code?
 
gll

WWW Email
Re: Vector - General Matrix Transformations
« Reply #2 on: Apr 29th, 2004, 6:11pm »

Thanks TomC for your comments.
 
I made some functions to export to PovRay, MegaPov (with physic simulations) and for AutoCAD. I used AutoLisp as a way to contruct the algorithm in AutoCAD. As I'm working with a Projective Software [SGDL], it also use SCHEME as interface. So what you  keep at the end is the algo to construct the object, rather than the description of the object itself.
 
But I'm curious about the way Simon Greenwold did it. There's many way to do this in fact. depending on the type of geometry.  
 
For the renderings, the main focus was to render the "Sculpture" in the Park. Construction is a lot of extra troubles! Maybe if you see the plans. They are simple. You'll see that it's far away to what it looks at the end.
 
Thanks for the link to DXFWriter, this is great set of functions. Did you used DXF class in your project?
 
Should I put lights in the Sketch? It'll be too slow I think on some computers? How it was on yours?
« Last Edit: Apr 29th, 2004, 6:16pm by gll »  

guillaume LaBelle
gll

WWW Email
Re: Vector - General Matrix Transformations
« Reply #3 on: Apr 29th, 2004, 6:12pm »

The syntax highlighting is done with Eclipse. I used my own word list. I used an extra color/wordlist for my new functions. I tried many colors, but the Pink set is great. This is magical, it make me so happy when I'm coding. Why they didn't tought to make the Apple][e screens pink rather than green and black?
« Last Edit: Apr 29th, 2004, 6:13pm by gll »  

guillaume LaBelle
fry


WWW
Re: Vector - General Matrix Transformations
« Reply #4 on: Apr 29th, 2004, 7:13pm »

i've been going back and forth with whether or not we should include matrix/vector classes in p5.  
 
right now it's not used in the graphics engine because it's actually faster to have 16 local variables store the matrix rather than an outside class. and while it could be helpful, in the interest of not increasing the number of classes, it's been left out.
 
however, i'm awfully tempted to put it in.. the core classes ("bagel") will be moving to a package called processing.core.*, and we should perhaps add a processing.math.* package which could store vec/matrix and other useful bits like that. other classes in there would be a basic integrator or maybe even a spring/particle system class (like simon's stuff he added for "MultiProcessing")..
 
re: the operator overloading.. it sure is tempting, and as tom says, it'd be a ways off.. but operator overloading can often be really confusing, and i understand why they left it out of the java spec in the first place.  
 
more thoughts? processing.math? make it optional? or make it small and included by default (i'm leaning towards the latter)?
 
TomC

WWW
Re: Vector - General Matrix Transformations
« Reply #5 on: Apr 29th, 2004, 9:37pm »

What's your opinion of the javax.vecmath package which comes with Java3D?
 
http://java.sun.com/products/java-media/3D/forDevelopers/j3dapi/index.ht ml
 
I've never understood why it wasn't rolled into the standard Java API.
 
I don't think you could be accused of code bloat for including vectors and matrices, anyway.  
 
Incidentally, how easy (once the API is finalised) would it be to deploy the Processing library jar once, like Sonia, or at least once per website, to avoid processing fans downloading the same bits over and over again?  
 
 
gll

WWW Email
Re: Vector - General Matrix Transformations
« Reply #6 on: Apr 30th, 2004, 6:39am »

This is quite new. I'm reading papers about projective geometry. It seems to be powerfull, but not really intuitive. Solid Modeling without any polygons.
 
As I worked on this project, it was clear that matrix transformations allow many complex transformations. This is well explained on this page: http://www.f-lohmueller.de/pov_tut/trans/matrix1e.htm
 

guillaume LaBelle
fry


WWW
Re: Vector - General Matrix Transformations
« Reply #7 on: Apr 30th, 2004, 7:26pm »

on Apr 29th, 2004, 9:37pm, TomC wrote:
What's your opinion of the javax.vecmath package which comes with Java3D
 
http://java.sun.com/products/java-media/3D/forDevelopers/j3dapi/index.ht ml
 
I've never understood why it wasn't rolled into the standard Java API.
 
I don't think you could be accused of code bloat for including vectors and matrices, anyway.  
 
Incidentally, how easy (once the API is finalised) would it be to deploy the Processing library jar once, like Sonia, or at least once per website, to avoid processing fans downloading the same bits over and over again  
 

the vecmath package looks quite good.. much cleaner and less overdone than most of sun's more recent apis
 
maybe it'd be a better route to include those as an option for folks, i don't think there will be much that we'd add that'd be unique to processing, so may not be a point in including our own. though i'll have to take a look at how big a .jar is for the necessary files.
 
regarding the single jar thing.. it'd probably be a good idea, especially for the number of sites that have multiple p5 applets. perhaps the thing to do would be to mark the jar file with its version number (i.e. core-0070.jar) that way it can properly point to things if/when API changes happen.
 
gll

WWW Email
Re: Vector - General Matrix Transformations
« Reply #8 on: May 9th, 2004, 7:16pm »

I'm back on a problem that I had when I done this project http://www.vif.com/users/goo/P55/StairKnot/index.html  
 
I'm trying to make it more simple by using normal transform operations(rotateXYZ). I have a vector which show the orientation and I have an object(a box for example) that has to be aligned in this direction. To reorient the object to this vector, I need to rotate the object in two direction at time.
 
Reorient an object to a direction is, I guess, a covenient way to work. To decompose a rotaion in sub-rotations (RotateX and RotateY) is really complex and I'm lost with trigo's problems.
 
Is there an elegant way to rotate in X and Z to reorient an object along an arbritrary path using the actual transform operations in P5?
« Last Edit: May 9th, 2004, 7:20pm by gll »  

guillaume LaBelle
fry


WWW
Re: Vector - General Matrix Transformations
« Reply #9 on: Jul 7th, 2004, 5:40pm »

rotate(float angle, float v0, float v1, float v2)
will give you a general rotate about a vector, as is found in other 3d packages. is that what you're looking for?
 
Pages: 1 

« Previous topic | Next topic »