Ergebnis 1 bis 11 von 11

Blender Phyton Script...

  1. #1 Zitieren
    Veteran Avatar von DragonX
    Registriert seit
    May 2011
    Ort
    Gummibärchenland
    Beiträge
    605
    Hallo
    Im Forum 3D Area habe ich schon nachgefragt und dort wurde mit empfohlen hier zu fragen

    Also ich mache gerade ein kleines Spiele Projekt da ich selber Cube und mich gefragt habe warum machst du das nichtmal in Blender?

    Also dabei wurde mir dieser Link gegeben: http://blenderartists.org/forum/show...BIX-CUBE-GAME&

    Dort steht in einem Post folgendes:

    No, it's impossible without python, you need to use a ton of variables to control the exact direction of each cube (basically emulate matrices, make a 3x3 cube and store: [rot1x,rot1y,rot2x,rot2y,rot3x,rot3y] that would control ONE row to make 3 rows you'd want to store:

    GameLogic.Row1 = [rot1x,rot1y,rot2x,rot2y,rot3x,rot3y]
    GameLogic.Row2 = [rot1x,rot1y,rot2x,rot2y,rot3x,rot3y]
    GameLogic.Row3 = [rot1x,rot1y,rot2x,rot2y,rot3x,rot3y]

    that wouldn't NEED to be done (you could just use 18 variables =X but that would be the best way.

    Theoretically I know exactly how I'd script a game like that, too bad I'm not joining your team =P if you need a script post it in my thread.

    Edit:

    Then you'd use pi:

    pi = 3.14
    to get 90 degrees you'd use:
    left = pi/2
    right = -pi/2

    then you'd set it so each time you rotate it adds 1 having 4 rotations for each axis: to have a 180 rot on the X it would be 2

    meaning if your cube was:

    OOO
    OOO
    OOO

    and you wanted
    OXO
    XOX
    OXO

    you'd need to do some advanced tweakings to the lines below:

    GameLogic.Row1 = [rot1x,rot1y,rot2x,rot2y,rot3x,rot3y]
    GameLogic.Row2 = [rot1x,rot1y,rot2x,rot2y,rot3x,rot3y]
    GameLogic.Row3 = [rot1x,rot1y,rot2x,rot2y,rot3x,rot3y]

    This could get tricky. But just tweaking the values will do nothing, you'll need to find a way to import IPOs for rotations into python and interact with the lists to extract each cube from the list and apply the rotation IPO, or you could do all the and follow 9(squared) empties (using get/setOrientation)

    Either way you'll need great python knowledge



    Leider habe ich keinen Plan von Phyton würde es aber gerne lernen und so Könnte mir jemand das Script erklären und vll beshreiben wie ich es einbauen muss?
    "To be a good professional engineer, always start to study late for exams. Because it teaches you how to manage time and tackle emergencies."
    -Bill Gates

    Need Gamekey? ---> http://www.kinguin.com.de/?acc=cegh8
    DragonX ist offline

  2. #2 Zitieren
    Veteran Avatar von DragonX
    Registriert seit
    May 2011
    Ort
    Gummibärchenland
    Beiträge
    605
    Hat niemand ne Ahnung bzw. Hilfe?
    "To be a good professional engineer, always start to study late for exams. Because it teaches you how to manage time and tackle emergencies."
    -Bill Gates

    Need Gamekey? ---> http://www.kinguin.com.de/?acc=cegh8
    DragonX ist offline

  3. #3 Zitieren
    Ritter Avatar von Delta 38
    Registriert seit
    Nov 2008
    Ort
    Bremen
    Beiträge
    1.251
    Also der Beitrag ist von 2009, da hat Blender noch einen ganz anderen Python-Interpreter benutzt. Das bedeutet, dass das Skript zu 99% nicht funktioniert.
    Schau dir mal das hier an.
    Weiter unten steht dann wie du mittels Python ein Objekt bewegst.
    Delta 38 ist offline

  4. #4 Zitieren
    Veteran Avatar von DragonX
    Registriert seit
    May 2011
    Ort
    Gummibärchenland
    Beiträge
    605
    Zitat Zitat von Delta 38 Beitrag anzeigen
    Also der Beitrag ist von 2009, da hat Blender noch einen ganz anderen Python-Interpreter benutzt. Das bedeutet, dass das Skript zu 99% nicht funktioniert.
    Schau dir mal das hier an.
    Weiter unten steht dann wie du mittels Python ein Objekt bewegst.
    Ok. Die Seite ist ganzschön unübersichtlich :P Ich versuchs jetztmal und wenns nicht geht melde ich mich nochmal

    Wo genau steht das mit Bewegung suche das gerade
    "To be a good professional engineer, always start to study late for exams. Because it teaches you how to manage time and tackle emergencies."
    -Bill Gates

    Need Gamekey? ---> http://www.kinguin.com.de/?acc=cegh8
    DragonX ist offline

  5. #5 Zitieren
    Ritter Avatar von Delta 38
    Registriert seit
    Nov 2008
    Ort
    Bremen
    Beiträge
    1.251
    Meinst du das?
    Code:
    bpy.context.active_object.location = [x,y,z]
    Damit veränderst du die Position eines Objektes.
    Delta 38 ist offline

  6. #6 Zitieren
    Provinzheld Avatar von Cheesecake
    Registriert seit
    Feb 2012
    Beiträge
    266
    Lern doch wenigstens erstmal die Grundlagen von Python, dann blickst du vielleicht auch alleine bei den Beispielen durch. Glaub mir, die Sprache ist sehr einfach und dementsprechend auch für absolute Anfänger gut geeignet. Wenn du schon Erfahrung mit einer anderen Sprache ist, dann natürlich umso besser.
    Cheesecake ist offline

  7. #7 Zitieren
    Veteran Avatar von DragonX
    Registriert seit
    May 2011
    Ort
    Gummibärchenland
    Beiträge
    605
    Zitat Zitat von Cheesecake Beitrag anzeigen
    Lern doch wenigstens erstmal die Grundlagen von Python, dann blickst du vielleicht auch alleine bei den Beispielen durch. Glaub mir, die Sprache ist sehr einfach und dementsprechend auch für absolute Anfänger gut geeignet. Wenn du schon Erfahrung mit einer anderen Sprache ist, dann natürlich umso besser.
    Naja ein ganz kleines bisschen html und nochweniger CSS ;D

    Wollte ich ja schon oft lernen aber wo? Wo ist es am besten zu lernen wo am anfang nicht über die ersteheung und blablabla gelabert wird...
    "To be a good professional engineer, always start to study late for exams. Because it teaches you how to manage time and tackle emergencies."
    -Bill Gates

    Need Gamekey? ---> http://www.kinguin.com.de/?acc=cegh8
    DragonX ist offline

  8. #8 Zitieren
    Ritter Avatar von Delta 38
    Registriert seit
    Nov 2008
    Ort
    Bremen
    Beiträge
    1.251
    Die Anfänge kannst du doch einfach skippen? Google mal nach Python-Tutorials. Achja und Code bitte in die Code-Tags [code][/code]
    Delta 38 ist offline

  9. #9 Zitieren
    Veteran Avatar von DragonX
    Registriert seit
    May 2011
    Ort
    Gummibärchenland
    Beiträge
    605
    Zitat Zitat von Delta 38 Beitrag anzeigen
    Die Anfänge kannst du doch einfach skippen? Google mal nach Python-Tutorials. Achja und Code bitte in die Code-Tags [code][/code]
    Ok habe jetzt von einem mal den Link bekommen den mache ich jetzt mal: http://docs.python.org/3/tutorial/index.html
    "To be a good professional engineer, always start to study late for exams. Because it teaches you how to manage time and tackle emergencies."
    -Bill Gates

    Need Gamekey? ---> http://www.kinguin.com.de/?acc=cegh8
    DragonX ist offline

  10. #10 Zitieren
    Veteran Avatar von DragonX
    Registriert seit
    May 2011
    Ort
    Gummibärchenland
    Beiträge
    605
    Also ich habe es jetzt geschafft das sich bei Rechtsklick die unterste Ebene dreht

    Yeah haha

    Ich versuche gerade verzweifelt das es sich nur dreht wenn ich auch über einem der Steine bin die sich dann drehen sollen.

    Hat noch irgendjemand einen Tipp wie ich den Würfel so programmiere, oder sogesehen entscheide ob er sich jetzt nach oben oder nach unten dreht...
    "To be a good professional engineer, always start to study late for exams. Because it teaches you how to manage time and tackle emergencies."
    -Bill Gates

    Need Gamekey? ---> http://www.kinguin.com.de/?acc=cegh8
    DragonX ist offline

  11. #11 Zitieren
    Veteran Avatar von DragonX
    Registriert seit
    May 2011
    Ort
    Gummibärchenland
    Beiträge
    605
    Meint ihr meine neue Theorie funktioniert/ machbar?

    https://www.dropbox.com/s/52chths7vgvhtpy/Cubeplan.png
    "To be a good professional engineer, always start to study late for exams. Because it teaches you how to manage time and tackle emergencies."
    -Bill Gates

    Need Gamekey? ---> http://www.kinguin.com.de/?acc=cegh8
    DragonX ist offline

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •