[Scroll down for something English-like]
Hallo liebe Leute,
in sämtlichen Tutorials und im Handbuch zu GS konnte ich zu meiner Frage bislang keine Antwort finden. Ich habe folgendes Problem an dem ich zurzeit knusper:
Ausgangssituation:
In einer separaten Datei habe ich ein Level geschrieben. Es ist eine Aneinanderreihung von Blöcken mit entsprechenden Eigenschaften, wie Position, Skalierung und Farbe.
Zuvor die Frage: Wie kann man einen einzelnen Block zur Laufzeit erstellen? (ohne model oder map etc.!!!!!!)
Ich helfe mir mit einem "Einheitsblock" als mdl aus, welchen ich entsprechend skaliere und das material entsprechend der Datei einstelle.
Nun das Problem: Das Material ist bei allen Blöcken gleich!
abstrahierter Code wie folgt:
- Eigenschaften aus Datei auslesen
- Entity mit entsprechender Position erzeugen und dem Pointer my zuweisen
- Entity skalieren
- über my.material... die Materialeigenschaften zuweisen
und das ganze so oft hintereinander wie laut Datei Blöcke benötigt werden.
Warum funktioniert die Positionszuweisung und Skalierung tadellos, nur die materialzuweisung nicht? Wahrscheinlich ein dummer Anfängerfehler o_O
MfG Jörn
-------------------------------
Zuletzt eine kleine Frage nebenbei:
Wie kann ich lite-c sagen, dass ich keine Map brauche?
(Map wird via Code erstellt)
_____________________________________________________
Hello folks,
I've got one question for you:
I want to create blocks during runtime, therefore I have got a file which contains position, size and color of each block. I read this file during runtime and create blocks. I can position and scale them as defined in the file, but the material is the same.
the code does something like:
-read file, get position/size/color
- create an Entity which contains only one block and set the pointer my to the new created Entity
- set Position and scaling
- now i set the material-settings with my.material...
the blocks are created right, but they look all the same! Why??
A little question before the end:
-How can I tell lite-c, that I don't want to use a map or terrain and still run the engine?
- I've helped myself out by using a model which contains a block. But how can I create blocks just with the engine, without extern files?
Whoever may find faults can keep them :-P
Greetings, Jörn