3d Flash Open Source für 3d Flash Editor, like Maya or 3d Gamestudio usw

Status
Nicht offen für weitere Antworten.

snakemedia

Gesperrt
Hallo Users,
Fortszusetug folgt von 3d Flash, wie Maya.....

Ich habe genua bewegliche Würfel gefunden.
Adresse: http://senocular.com/flash/source.php?id=0.162

Code:
Stage.scaleMode = 'noScale';
// 3D rotation is defined by an object
// which has rotation values for each axis
var rotations = {x:0, y:0, z:0};
// The points within the cube are defined
// in an array called boxPoints
var boxPoints = [{x:-50, y:-50, z:-50}, {x:50, y:50, z:-50}, {x:-50, y:50, z:-50}, {x:-50, y:-50, z:50}, {x:50, y:-50, z:50}, {x:50, y:50, z:50}];
/* Points
3 - 4
/   /|
0 -   5
|   |/
2 - 1
 
Notice that 2 points are missing, one in the front upper
right and one in the back lower left. These are not needed
since each side only requires 3 points to define its place
in 3D space.  Depending on intented image orientation,
though, these points may be necessary for your images to
go and face where you want them to
*/
// create a movie clip for the cube to reside
// place it in the center of the screen
this.createEmptyMovieClip("theScene", 1);
theScene._x = theScene._y=150;
// generate each image for the cube
createImages();
// define enter frame event for rotating cube and
// positioning images within it
theScene.onEnterFrame = function() {
// adjust axis rotations based on mouse position
rotations.x -= this._ymouse/2000;
rotations.y += this._xmouse/2000;
// transform original 3D points to 2D based on rotations
var points2d = pointsTransform(boxPoints, rotations);
// for each image clip, use movieClip3PointTransform
// to alter its transform matrix so that it matches to
// 3 points within points2d
movieClip3PointTransform(this.image0, points2d[2], points2d[0], points2d[3]);
movieClip3PointTransform(this.image1, points2d[5], points2d[1], points2d[2]);
movieClip3PointTransform(this.image2, points2d[0], points2d[2], points2d[1]);
movieClip3PointTransform(this.image3, points2d[4], points2d[3], points2d[0]);
movieClip3PointTransform(this.image4, points2d[3], points2d[4], points2d[5]);
movieClip3PointTransform(this.image5, points2d[1], points2d[5], points2d[4]);
};
// create images as empty movie clips.  Each contains another
// empty movie clip in which each bitmap is attached. Using this
// inner movie clip, any sized bitmap can be used and it will
// stil conform to the size needed in the cube as this clip
// is referenced in movieClip3PointTransform.
function createImages() {
// for each side
var i = 6;
while (i--) {
// create an image movie clip
theScene.createEmptyMovieClip("image"+i, i);
// create a contents clip
theScene["image"+i].createEmptyMovieClip("contents", i);
// attach the appropriate bitmap in the contents clip
theScene["image"+i].contents.attachBitmap(flash.display.BitmapData.loadBitmap("image"+i), 1, false, true);
}
}
// transforms 3d points into 2d points based 
// on the rotation values provided
function pointsTransform(points, rotations) {
var tpoints = new Array();
var sx = Math.sin(rotations.x);
var cx = Math.cos(rotations.x);
var sy = Math.sin(rotations.y);
var cy = Math.cos(rotations.y);
var sz = Math.sin(rotations.z);
var cz = Math.cos(rotations.z);
var x, y, z, xy, xz, yx, yz, zx, zy;
var i = points.length;
while (i--) {
x = points[i].x;
y = points[i].y;
z = points[i].z;
// rotation around x
xy = cx*y-sx*z;
xz = sx*y+cx*z;
// rotation around y
yz = cy*xz-sy*x;
yx = sy*xz+cy*x;
// rotation around z
zx = cz*yx-sz*xy;
zy = sz*yx+cz*xy;
tpoints[i] = {x:zx, y:zy};
}
return tpoints;
}
// this function sets the transform for the image movie clips
// each a, b, c, and d of the transform matrix are simply
// based on the difference of positions of the points
// they need to match with.  The image movie clips' contents
// sizes are required to determine how much of that difference
// is actually applied to make the transform match
function movieClip3PointTransform(mc, a, b, c) {
// deterimine visibility
mc._visible = pointsIsVisible(a, b, c);
// if not visible, exit function
if (!mc._visible) {
return;
}
// set values for matrix using point b as top left 
var m = mc.transform.matrix;
m.tx = b.x;
m.ty = b.y;
m.a = (a.x-b.x)/mc.contents._width;
m.b = (a.y-b.y)/mc.contents._width;
m.c = (c.x-b.x)/mc.contents._height;
m.d = (c.y-b.y)/mc.contents._height;
mc.transform.matrix = m;
}
// using a 2D relationship between 3 points
// determine if a 3D face is visible
function pointsIsVisible(a, b, c) {
var db = b.x-a.x;
if (!db) {
return (a.y>b.y == c.x>a.x);
}
var dc = c.x-a.x;
if (!dc) {
return (a.y>c.y == b.x<a.x);
}
return ((b.y-a.y)/db<(c.y-a.y)/dc) != (a.x<b.x == a.x>c.x);
}

Es ist so ähnlich. ich kenne diese Rotation -Modus.

Ich will ein "3D Flash Editor" erstellen, wie bei unser G-Max oder 3d Gamestudio, Dreidisemonalsprogramm.

Für Beispeil:
  1. Ich erstelle ein erstes Raum aus dem 3D Flash Editor. z.B. 6 Quadern (= Rechtecksäule oder Prisma).
  2. Ich lege die gewünschten Texturen / Mustern, wie Wände, Decke, Boden...
  3. Ich stelle ein Spielfigur, wie so ähnlich Info_player_start von Half-Life 2 und stelle jetzt einiges Licht ins virtuelles Raum.
  4. Ich teste jetzt Flash-enables 3D-Spiel als eigenes Spielprogramm, wie kennt ihr über Computerspiele: Half-Life 2, Halo2, Tany Hawk's Pro Skater 2 oder anderes..
Ich möchte jetzt Flash enable 3D-Programm programmieren und bauen. Wie soll ich genau die Kamera-Ansicht des 3D-Programms mit Tastatur und Maus steuern?
Die Rasterfenster (Boden-, Vorder- und Seitenansicht) soll ich einiges Block zeichnen , dann wird die Kamera-Ansicht sichtbar, wenn ein erstes Würfel als Standard-Tecture erhältlich sein wird.

Und ich brauche spezielle Komplizierungsprogramm für 3D-Flash Editor, wie kennt ihr sehr alte Komplizier von Quake 2.

Die wichtige Funktion für Komplizierung:
  1. Zugriff, wie dieser Fehler als "invaid block" oder "Error: Loading this worng texture" usw...
  2. Arbeite mit Blöcken, wenn es in die Ordnung ist wie BSP-Überabeitung
  3. Arbeite mit Spitzen oder Displacements (= Bergswellen) und ausgehüllte Raumluft wie CSG-Arbeitung
  4. Arbeite mit den Lichten und lickt-aktiven Blöcken wie Rad- oder Light-Arbeitung
  5. Arbeite die ganze Karte wie VIS-Arbeitung
Ich brauche eure Hilfe für richtige Tipp und OpenSource für 3D-Flash Editor oder eigenes 3D-Programm, wenn ich sicher verstehe.

Danke für Antworten!
Bis bald SnakeMedia
 
Da Flash keine z-Achse kennt (z ist in o.g. Beispiel nur der Name einer Variable), wird das nicht funktionieren.
Flash kann nur 2D, alles was wie 3D aussieht ist gefaked, d.h. Größen und Tiefensortierung berechnet und dargestellt aber eben dennoch 2D.
Ähnlich wie wenn man einen Würfel auf Papier zeichnet - deshalb sind Papier und Bleistift aber noch lange kein 3D-Programm.
Deshalb spricht der gute alte senocular ja richtigerweise auch explizit von einer "psuedo-3D box"

Kompiler für Flash ohne Flash möglicherweise auf:
http://www.osflash.org

Falls du generell und nicht zwingend auf Flash-Basis ein Open-Source-3D-Programm bauen willst - das gibt es schon
http://www.blender.org
 
Zuletzt bearbeitet:
Rena Hermann hat gesagt.:
Falls du generell und nicht zwingend auf Flash-Basis ein Open-Source-3D-Programm bauen willst - das gibt es schon
www.blender.org
Danke für Links gefunden, meine liebe Benutzerin, Rena! :)

Aber Blender ist kein Flash Editor able Programm sondern unbekannte Programmierungsprache als Applikation wie gMax, Softimage XSI!

bis bald SnakeMedia
 
Status
Nicht offen für weitere Antworten.

Neue Beiträge

Zurück