LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 


  #1  
Old 05-13-2009, 11:02 AM
hanenbro hanenbro is offline
Registered User
 
Join Date: May 2009
Location: United Kingdom
Posts: 1
Rep Power: 0
hanenbro is on a distinguished road
Question Compound 3D rotation/translation

Hello,

This is a bit more of a conceptual/mathsy problem than a technical one, but I am working in Flash CS4 and I thought this would be a good place to ask.

What I'm trying to do, essentially, is generate a 3D structure of square panels (subclassed sprites), connected perpendicularly at their edges. There are two connection parameters I'm planning to allow (and pick randomly between these on generation):
1) connecting edge:- top; bottom; left; or right
2) joining angle:- outer (where the connecting panel points away from the previous one; 270 degrees from the front); and inner (where the connecting panel points towards the screen from the previous one; 90 degrees from the front).

Defining where the subsequent panel should be placed from the initial one is quite straightforward. As an example, if the first panel is facing front on the stage, and the next connecting panel is selected to make a left-outer join, then (assuming panels have a registration point in the centre) that new panel should have the following transformations applied after being placed on top of the original:
- Add 90 to the .rotationY property (so it faces the left of the stage)
- Subtract half the panel's width from the .x property (so that it moves left to the edge of the first panel)
- Add half the panel's width to the .z property (so that its rightmost edge touches the leftmost edge of the original panel, perpendicularly)

I can quite easily define 8 transformation patterns like that for my 8 combined joining types, and use Math.random with Math.floor to pick one from an array. The problem I then have is that those defined transformations are relative to the starting point of the first panel, and so I can't use them repeatedly from their original state. Once the subsequent panels have been rotated, the set of 8 no longer apply.

So! I imagine related problems have been tackled before, and I was hoping for some general advice - not a free solution to the problem. If you know of any reading I could do on combining the 3D transformations in this way, that would be really helpful. I just don't know where to start!

Thanks loads!
Reply With Quote
  #2  
Old 06-13-2009, 08:58 PM
FlashMove's Avatar
FlashMove FlashMove is offline

FlashMove Master
 
Join Date: Jan 2000
Location: Singapore
Posts: 4,597
Rep Power: 10
FlashMove is on a distinguished road
Hi hanenbro, welcome to FlashMove forums.
I believe you might be looking for a carousel kind of 3d transformation?
There's a few of these around here. Do feel free to do a search for carousel gallery here.
__________________
Actionscript tag . Donate Here . Testimonial . Join Flash Chat UserGroup . Twitter . Facebook
Reply With Quote
  #3  
Old 06-14-2009, 05:06 AM
puppy's Avatar
puppy puppy is offline
Guide
 
Join Date: Dec 2002
Posts: 2,875
Rep Power: 13
puppy is on a distinguished road
Quote:
The problem I then have is that those defined transformations are relative to the starting point of the first panel, and so I can't use them repeatedly from their original state. Once the subsequent panels have been rotated, the set of 8 no longer apply.
when you add a plane A as a child to plane B, and then plane C as a child to plane B, transformations B-to-A and C-to-B could still be the same.
__________________
Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump




All times are GMT. The time now is 04:00 PM.