It is currently 20 May 2013, 02:01

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: City Generation
PostPosted: 27 Jun 2011, 18:20 
Offline

Joined: 22 Mar 2010, 18:43
Posts: 391
Alright, I've finally got time to continue working on this. Nothing new to see at the moment, sorry.

I have a question regarding matrices, maybe somebody can help? For all building elements I am storing a 4x4 matrix that contains scaling, translation and rotation data (I use the "SRT to Matrix" node). Now I will need to store additional information for some elements, such as extrusion length, floor type etc. I would like to store all of this additional data in the same 4x4 matrix because that would keep things neat and clean.

It appears that the LAST COLUMN of this matrix always says 0,0,0,1 - regardless of what values I choose in the "SRT to Matrix". Am I right in assuming that I can simply use these 4 slots to store scalar data without EVER destroying the SRT info?


Top
 Profile  
 
 Post subject: Re: City Generation
PostPosted: 27 Jun 2011, 20:04 
Offline

Joined: 23 Jun 2009, 21:01
Posts: 240
Chris_TC wrote:
I have a question regarding matrices, maybe somebody can help? For all building elements I am storing a 4x4 matrix that contains scaling, translation and rotation data (I use the "SRT to Matrix" node). Now I will need to store additional information for some elements, such as extrusion length, floor type etc. I would like to store all of this additional data in the same 4x4 matrix because that would keep things neat and clean.

It appears that the LAST COLUMN of this matrix always says 0,0,0,1 - regardless of what values I choose in the "SRT to Matrix". Am I right in assuming that I can simply use these 4 slots to store scalar data without EVER destroying the SRT info?


I suppose you could as long as you are very careful to set those values back before using the matrix as a transform in any way because once you change those values, the matrix no longer represents a valid transformation. However, I don't think that all the packing and unpacking of matrices that would be required is any more "neat and clean" than storing separate attributes -- quite the opposite in fact.


Top
 Profile  
 
 Post subject: Re: City Generation
PostPosted: 27 Jun 2011, 22:21 
Offline

Joined: 22 Mar 2010, 18:43
Posts: 391
I need to keep all these value arrays in sync. Every rule needs to update every array. I figured that maintaining only one matrix array is the best solution, but maybe separate arrays are better. I'll take a look, thank you!


Top
 Profile  
 
 Post subject: Re: City Generation
PostPosted: 27 Jun 2011, 23:35 
Offline

Joined: 18 Jun 2009, 19:58
Posts: 61
I wouldn't store data in the transformation matrix, it seems predestined to bite you in the butt later on. And in doing so you will have moved from storing all data in an open, shared way to essentially storing data in a custom format that requires a translation layer.

Also, you may want more than three or four scalar values later on, or to store data of different types. You are almost certainly better storing data in multiple arrays and using an ID to keep everything in sync.


Top
 Profile  
 
 Post subject: Re: City Generation
PostPosted: 28 Jun 2011, 00:20 
Offline

Joined: 22 Mar 2010, 18:43
Posts: 391
Yes, I think you're both right. That's how I'll do it. It's good that I cleared this up right away, because it's such an important part of the system, and having to change it all way down the line would be a nightmare.


Top
 Profile  
 
 Post subject: Re: City Generation
PostPosted: 28 Jun 2011, 03:33 
Offline
User avatar

Joined: 19 Mar 2010, 00:38
Posts: 442
Location: St. Thomas, Ontario
Chris,

The 4 x 4 Matrix is called Homogeneous Transform Matrix. Here are some information concerning the matrix and its use in graphics:

http://blogoben.wordpress.com/
http://www710.univ-lyon1.fr/~jciehl/Public/OpenGL_PG/apf.html
http://math.hws.edu/graphicsnotes/c3/s1.html
http://www.cs.iastate.edu/~cs577/handouts/homogeneous-transform.pdf
http://graphics.ucsd.edu/courses/cse167_f05/CSE167_03.ppt

Cheers!

Dan

BTW, word of caution concerning matrices from Matt Lind at XSI List:

Quote:
When looking for references on Matrices, one thing to pay attention to is whether the equations use row or column vectors as that will impact computations. Softimage is row vectors. If you find an equation that uses column vectors, you will have to transpose the matrix to make it row aligned.


Good explaination of row and column vectors here:

http://www.cse.ttu.edu.tw/~jmchen/cg/docs/rendering%20pipeline/rendering/vector_matrix.html#transpose

P.S. OpenGL is column vertors based

_________________
$ifndef "Softimage"
set "Softimage" "true"
$endif


Top
 Profile  
 
 Post subject: Re: City Generation
PostPosted: 28 Jun 2011, 10:37 
Offline

Joined: 22 Mar 2010, 18:43
Posts: 391
Thanks for the links, Daniel!


Top
 Profile  
 
 Post subject: Re: City Generation
PostPosted: 16 Jul 2011, 18:09 
Offline
User avatar

Joined: 20 Mar 2011, 02:01
Posts: 306
Location: Leiden, the Netherlands
Oh my god this is so great!! I too was thinking it would be possible to generate cities with ICE and was a bit dissapointed when i saw the videos on youtube that just deal with floor numbers.

I originally got really inspired when i saw this: http://www.youtube.com/watch?v=-d2-PtK4F6Y&feature=feedlik wich has nothing to with ICE - but is just damn cool.

You're really far along already!!

I'm gonna read your post more carefully and try to reproduce it but i just had to respond immediatly when i skimmed it - it's just great when someone has the same vision and has already done a lot of the legwork! ;)

^:)^ ^:)^ ^:)^

_________________
My Nooby Animation Project
KP on DA


Top
 Profile  
 
 Post subject: Re: City Generation
PostPosted: 16 Jul 2011, 21:08 
Offline

Joined: 22 Mar 2010, 18:43
Posts: 391
Yes, it's been a while since I posted an update. But I have kept on working on this. I've done a ton of stuff under the hood to ensure proper usability. I don't know how often I've modified my split compound now, but it's become a powerhouse, so that was worth it.

I'm planning on showing the current functionality in a video hopefully on Monday.


Top
 Profile  
 
 Post subject: Re: City Generation
PostPosted: 17 Jul 2011, 02:30 
Offline
Moderator
User avatar

Joined: 21 Jul 2010, 00:33
Posts: 501
hey Chris this is looking awesome! I'll sure keep up reading this thread for updates :)

_________________
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/blog | Training: http://gustavoeb.com.br/blog/?cat=16&lang=en_us


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group