3D Vector Physics (practical situation)

  • Context: Undergrad 
  • Thread starter Thread starter Alphabit
  • Start date Start date
  • Tags Tags
    3d Physics Vector
Click For Summary

Discussion Overview

The discussion revolves around a problem encountered while programming a vector-based 3D engine in Flash, specifically focusing on the challenges of z-sorting 3D planes in a way that accurately represents their spatial arrangement. The scope includes technical aspects of 3D graphics programming and potential mathematical solutions.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • The original poster describes a method of using the average z-value of points in each plane to determine their order in 3D space, but notes that this method has limitations in flexibility and accuracy.
  • There is a suggestion that a z-buffer could be used to track individual pixel z-values for rendering, although the original poster seems to be looking for a different approach due to processing constraints.
  • Another participant questions whether Flash can utilize OpenGL for hardware acceleration, which could potentially improve performance.
  • A later reply clarifies that Flash does not support hardware acceleration, indicating limitations in the capabilities of the platform for 3D rendering.

Areas of Agreement / Disagreement

Participants express uncertainty about the feasibility of achieving effective z-sorting within the constraints of Flash, with differing opinions on the use of z-buffers and hardware acceleration. No consensus is reached on a definitive solution.

Contextual Notes

The discussion highlights limitations related to the processing power of ActionScript 3.0 and the absence of hardware acceleration in Flash, which may impact the proposed solutions for z-sorting.

Alphabit
Messages
6
Reaction score
0
Hi everyone, this is my first post on this forum.

Anyway, I was hoping that you might be able to solve a problem I've encountered while programming a vector-based 3D engine in Flash. Here's an example of what I made with it:
http://jongro.phpnet.us/space.html" - It might look like it's working fine, but there is a limitation...

Basically, the API I made takes arrays of 3D planes which are grouped into Building Blocks (a series of planes grouped together to form a 3D basic shape)... Then each of these building blocks is assembled into a final 3D object which you should be able to see in the link above.

Now, you don't really need to worry about the structure, but it might help you find a solution. In any case, each plane has exactly 4 3D points (x, y, z) and, using these 3D points, I need to find a way to arrange the planes in 3D space from front to back. *EDIT* to make a triangular shape, I just set two of the points to the same coordinates... And yes, I know this causes problems with my current z-sorting algorithm*/EDIT*

The way I've done it is took the average z-value of every point in each plane which gave me the "z-index center point" of each plane at any time and I used this number to sort the planes from greatest to least... And display them on the screen accordingly.

Now The problem with this is that It allows very little flexibility in the design of my 3D objects. Take this for http://jongro.phpnet.us/3ddddd.gif" (they won't make a great deal of sense as they are, but you'll get the drift).
From looking at the diagram we can tell that the semi-transparent square-plane will be in front of the other one... But the problem is that, in some cases, the average z-index will not accurately tell which plane is in front.

Another problem is that, due to the limited processing power of the programming language I am using (ActionScript 3.0), I cannot have it do a per-pixel z-sorting... Instead I have to find a way to make the z-sorting work using Vector physics or other mathematical concepts.

Also, it might be processor intensive if I were to do comparative-checking, but if you've got a good way of doing it, please share.
That being said, I would rather have a system where every plane generates a value which will automatically place it in the correct position if sorted numerically against other planes.

Is there a way to do this, please share your ideas on this, thanks.

P.S. Please avoid using mathematical terms or if you do, tell me what they represent because I'm not much of a mathematician or physicist.:smile:
 
Last edited by a moderator:
Physics news on Phys.org
... It seems more complicated than I thought.
Does anyone have any pointers on this? Is it even possible?

Thanks
 
Your video card normally uses a z-buffer. Considering how far you've come already, I presume you can find out all the details yourself (basically, just keep track of the z value for each individual pixel, in order to decide whether to paint over it). Can flash use openGL?
 
cesiumfrog said:
Can flash use openGL?

No, Flash does not support hardware acceleration; I guess Macromedia/Adobe thought it was best to keep the Flash Player as small, compact and portable as possible.
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
17
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K