abbrechen
Suchergebnisse werden angezeigt für 
Stattdessen suchen nach 
Meintest du: 
abbrechen
Suchergebnisse werden angezeigt für 
Stattdessen suchen nach 
Meintest du: 
Programmierung
Alles über Programmierung in GDL und Python

Probleme mit GROUP

Anonymous
Nicht anwendbar
Kann mir einer sagen wieso ich beim folgenden Beispiel in ArchiCAD einen Gruppenbearbeitungs Fehler bekomm ?

Achja, nebenbei an Graphisoft:
Da ist ein rechtschreibfehler drin 🙂
da steht in der Fehlermeldung
"Gruppenbearbeiotungs Fehler" nicht
"Gruppenbearbeitungs Fehler"

Wenn ich die Beiden gruppen nicht mit addgroup zusammen addiere, sondern einzeln mit placegroup anzeige passt alles.

Ich muss aber später noch was abziehen, daher muss ich addieren.

Achso bevor ihr fragt, ja ich steh auf matrizen 😉

GROUP "result"
ENDGROUP
result = "result"
XFORM 1, 0, 0, 280,
0, 1, 0, 2072.5,
0, 0, 1, 200.5
GROUP "Teil1"
!push matrix to stack
XFORM 0, 0, 1, 0,
0, 1, 0, 0,
-1, 0, 0, 0
EXTRUDE 15, 0, 0, 1820, 63,
-20, 27, 1,
-20, 17, 1,
-18, 17, 1,
-18, -3, 1,
-20, -3, 1,
-20, -13, 1,
-15, -13, 1,
-15, 0, 1,
0, 0, 1,
0, 27, 1,
-3, 27, 1,
-3, 3, 1,
-15, 3, 1,
-15, 27, 1,
-20, 27, -1
!delete matrix from stack
DEL 0
ENDGROUP
result = ADDGROUP(result,"Teil1")
GROUP "Teil2"
!push matrix to stack
XFORM 0, 0, 1, 1800,
-1, 0, 0, -50,
0, -1, 0, 700
REVOLVE 14, 90, 127,
-77, 680, 1,
-67, 680, 1,
-67, 682, 1,
-47, 682, 1,
-47, 680, 1,
-37, 680, 1,
-37, 685, 1,
-50, 685, 1,
-50, 700, 1,
-77, 700, 1,
-77, 697, 1,
-53, 697, 1,
-53, 685, 1,
-77, 685, 1
!delete matrix from stack
DEL 0
ENDGROUP
result = ADDGROUP(result,"Teil2")
PLACEGROUP result
6 ANTWORTEN 6
Anonymous
Nicht anwendbar
Wenn Du das XFORM aus der Gruppe herausnimmts, gibt es keinen Fehler mehr.
Da ich noch nie mit XFORM gearbeitet habe, würde mich interessieren, was Du damit erreichen willst.
Anonymous
Nicht anwendbar
Mit XForm kann man eine matrix angeben.
Also verschiebungen und Rotationen einbauen.

Quasi ein
rotx,roty,rotz,addx,addy,addz

in einem 🙂

Wenn man das rausnimmt stimmt das Ergebnis nichtmehr

[ 29. Juli 2004, 12:24: Beitrag editiert von: Momo ]
andreaszeike
Newcomer
Das würde mich aiuch heftig interessieren... kannst Du es mal näher erklären?

Gruß, az
Anonymous
Nicht anwendbar
Vielleicht hilft dir folgendes Skript:
</font><blockquote><font size="1" face="Verdana, Helvetica, sans-serif">Code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">! XFORM Overview and Demo
! Karl Ottenstein, Ottenstein Consulting Services
! July 13, 2001
! karl@r...
! Sandpoint, Idaho USA

! Laurent asked about how the XFORM command is used in GDL. This object
! gives an overview, demo, and some references to textbooks at the end.

! Representing a point as a vector (x, y, z), one can apply matrix algebra
! in order to move (translate), scale, or rotate that point. According to
! Foley and van Dam (ref at end), the concept of homogeneous coordinates
! originated in geometry in 1946 by E. Maxwell at Cambridge. Homogeneous
! coordinates, and their transformations, extend a point vector with an
! additional scale factor - so (x, y, z) becomes (x, y, z, 1)

! The homogeneous transformation matrix for translation only is:
! 1 0 0 0
! 0 1 0 0
! 0 0 1 0
! dx dy dz 1
!
! So, with dx, dy, dz as 3, 6, 9, similar to ADD 2, 4, 6:
! 1 0 0 0
! 0 1 0 0
! 0 0 1 0
! 2 4 6 1
!
! Multiply a point (x, y, z, 1) in homogenous coordinate space
! (the extra 1) with the above matrix: pt * M and you get
! (x+2, y+4, z+6, 1) - a "translated" (shifted) point.
!
! Read DOWN the matrix columns as entering data for the XFORM, and
! leave off the last column of the 4x4 matrix above.

if jmp and jmp<5 then goto jmp*10
BLOCK 1, 4, 8
XFORM 1, 0, 0, 2,
0, 1, 0, 4,
0, 0, 1, 6
! Make an asymmetric block in order to see what's going on
BLOCK 1, 4, 8

DEL 1 : end

10:
! The homogeneous transformation matrix for scaling only is:
! sx 0 0 0
! 0 sy 0 0
! 0 0 sz 0
! 0 0 0 1
!
! So, with sx, sy, sz as 2, .5, .5, similar to MUL 2, 0.5, 0.5
! you have:
! 2 0 0 0
! 0 0.5 0 0
! 0 0 0.5 0
! 0 0 0 1
!
! Multiply a point (x, y, z, 1) in homogenous coordinate space
! by the above matrix: pt * M and you get
! (x*2, y*0.5, z*.05, 1)
!
! Read DOWN the matrix columns as entering data for the XFORM, and
! leave off the last column of the 4x4 matrix above.

goto 20
XFORM 2, 0, 0, 0,
0, 0.5, 0, 0,
0, 0, 0.5, 0
! Make a sphere in order to see what's going on
SPHERE 0.5

DEL 1 : end



20:
! Before we proceed to rotation - let's combine translation and scaling,
! using the same numbers as above. Notice that the XFORM below replaces
! one ADD and one MUL at this point:

goto 30:
! Translate and scale together
block 1,1,1 !SPHERE 2
XFORM 2, 0, 0, 2,
0, 0.5, 0, 4,
0, 0, 0.5, 6
! Make a sphere in order to see what's going on
block 1,1,1 !SPHERE 2

DEL 1 : end

!The transformation matrix for rotation "a" degrees about the Z axis is:
! cos(a) sin(a) 0 0
! -sin(a) cos(a) 0 0
! 0 0 1 0
! 0 0 0 1
!For "a" degrees about the X axis:
! 1 0 0 0
! 0 cos(a) sin(a) 0
! 0 -sin(a) cos(a) 0
! 0 0 0 1
!And, for "a" degrees about the Y axis:
! cos(a) 0 -sin(a) 0
! 0 1 0 0
! sin(a) 0 cos(a) 0
! 0 0 0 1

30:
! So...let's rotate a block
! about the Y axis 30 degrees...same as ROTY 30

goto 40

ang = 30
cosa = cos(ang)
sina = sin(ang)

XFORM cosa, 0, sina, 0,
0, 1, 0, 0,
-sina, 0, cosa, 0
! Make an asymmetric block in order to see what's going on
BLOCK 1, 4, 8

DEL 1 : END


40:
ang=40
XFORM 1,0,0,0,
0,1,0,0,
TAN(ang),0,1,0

block 1,1,1 !CYLIND 0.5,1
DEL 1 : end

!
! Note that the matrices are combined by multiplying them together,
! giving a new 4x4 transformation matrix. Any number of transformations
! can be combined into one final matrix - represented by a single
! GDL XFORM. Email me if you want me to post an explanation and
! example.
!
! This is probably not that useful for most GDL programmers, but
! would be very handy for API developers. (Picture an add-on where the
! user has sliders to rotate, scale and translate an object. The final
! settings could be saved as a single XFORM.)

! References
!
! These books are dated, as am I. No doubt there are newer additions,
! and even other, newer books out there now. Two of them were
! classics, and I expect still are.
!
! Foley, J. D. and van Dam, A. Fundamentals of Interactive Computer
! Graphics. Addison-Wesley (1982) 664 pages. This was THE book to
! have - there must be a newer edition.
! ISBN for this edition 0-201-14468-9.
!
! Giloi, Wolfgang K. Interactive Computer Graphics.
! Prentice-Hall (1978) 354 pages.
!
! Harrington, Steven. Computer Graphics: A Programming Approach.
! McGraw-Hill (1983) 448 pages.
!
! Newman, William M. and Sproull, Robert F. Principles of
! Interactive Computer Graphics, 2nd Edition.
! McGraw-Hill (1979) 541 pages. This was the bible for graphics
! when I was in school.
!
! Karl Ottenstein, July 2001.benötigt Parameter JMP als numerischen mit Werebereich 1 bis 4.
andreaszeike
Newcomer
...ach so!! Danke, Ove!! (Das Beispiel funzt allerdings nur, wenn man die goto 20, 30 und 40 herauslöscht)

Gruß, az
Anonymous
Nicht anwendbar
<OBJECT ID="GDLCtl" codebase="http://www.gdlcentral.com/bin/files/GDLCtl.cab#version=1,2,5,178" WIDTH="200" HEIGHT="200" CLASSID="CLSID:64D9B72C-E42A-490e-9181-221E1E035A14"><PARAM NAME="GdllistTxt" VALUE=""><PARAM NAME="SRC" VALUE="http://www.gdl-talk.de/objekte/XFORM_Demo.gsm"><embed name='GDLCtl' width='200' height='200' Src='http://www.gdl-talk.de/objekte/XFORM_Demo.gsm' GdlListTxt=''></OBJECT>
Hier ein XFORM-Testobjekt, bei dem man jeden Wert als Parameter eingeben kann, um zu sehen, welche Auswirkungen das hat.
Am Interessansten sind die Winkelverschiebungen, weil man damit ein Objekt Diagonal verzerren kann.
Das Strecken und das Verschieben funktioniert ja auch mit MUL und ADD.