mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 16:40:13 +02:00
adding textures to poly line"
This commit is contained in:
parent
a44e5f949c
commit
bad6aa8f0a
2 changed files with 9 additions and 10 deletions
|
@ -26,10 +26,6 @@ float rand(vec2 point){
|
|||
void main(void) {
|
||||
int frontCondition = 1 -int(gl_FrontFacing) * 2;
|
||||
vec3 color = gl_Color.rgb;
|
||||
color.r = mix(0, -1.0, modelPosition.x);
|
||||
if(color.r > 1.0) {
|
||||
color.b = 1.0;
|
||||
}
|
||||
|
||||
packDeferredFragment(
|
||||
newNormal * frontCondition,
|
||||
|
|
|
@ -114,21 +114,24 @@ bool PolyLineEntityItem::setStrokeWidths(const QVector<float>& strokeWidths ) {
|
|||
|
||||
bool PolyLineEntityItem::setNormals(const QVector<glm::vec3>& normals) {
|
||||
_normals = normals;
|
||||
if( _normals.size() != _points.size()) {
|
||||
// qDebug() << "normals dont equal points!";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_points.size () < 2) {
|
||||
// qDebug() << "points size is less than 2!";
|
||||
return false;
|
||||
}
|
||||
|
||||
int minVectorSize = _normals.size();
|
||||
if (_points.size() < minVectorSize) {
|
||||
minVectorSize = _points.size();
|
||||
}
|
||||
if (_strokeWidths.size() < minVectorSize) {
|
||||
minVectorSize = _strokeWidths.size();
|
||||
}
|
||||
|
||||
// int minArraySize = glm::min(_normals.size(), _points.size())
|
||||
_vertices.clear();
|
||||
glm::vec3 v1, v2, tangent, binormal, point;
|
||||
|
||||
for (int i = 0; i < _points.size()-1; i++) {
|
||||
for (int i = 0; i < minVectorSize-1; i++) {
|
||||
float width = _strokeWidths.at(i);
|
||||
point = _points.at(i);
|
||||
|
||||
|
|
Loading…
Reference in a new issue