Wrong colors in built-in draw functions (8.10 public beta)

Posted By: Saturnus

Wrong colors in built-in draw functions (8.10 public beta) - 12/18/10 17:14

The following code gives me unexpected results in both 8.10 public beta and 7.86.

The code should draw a red line, a yellow point and an orange point.

However, in 8.10 the line is grey in color (128/128/128) and the two points are both yellow in color (5/255/255, BGR).

In 7.86 the line is displayed correctly but the points are displayed as in 8.10.

I have the latest DirectX runtime installed.

Code:
#include <acknex.h>

void main() {
	level_load(NULL);
	vec_set(&sky_color, COLOR_WHITE);
	
	while (1) {
		draw_point3d(vector(32, 0,  5), vector(0, 255, 255), 100, 2);
		draw_point3d(vector(32, 0, -5), vector(0, 128, 255), 100, 2);
		
		draw_line3d(vector(32, -32, 0), NULL, 100);
		draw_line3d(vector(32, -32, 0), vector(0, 0, 255), 100);
		draw_line3d(vector(32,  32, 0), vector(0, 0, 255), 100);
		
		wait(1);
	}
}


Posted By: Spirit

Re: Wrong colors in built-in draw functions (8.10 public beta) - 12/19/10 10:22

I have the same problem with your code, I get the wrong colors with all versions, 7.86, 8.03 and 8.10.
Posted By: the_mehmaster

Re: Wrong colors in built-in draw functions (8.10 public beta) - 12/19/10 11:00

This is indeed strange -- When I use your code, it is grey also. But when I change it to what I have posted here, all works well.

I think there's something going on here..


Code:
#include <acknex.h>
#include <default.c>

function draw_red_rect(x1,y1,x2,y2)
{  while(1)
  {   
  	draw_line3d(vector(x1,y1,0),NULL,100); // move to first corner  
  	draw_line3d(vector(x2,y1,0),vector(0,0,255),100); 
  	draw_line3d(vector(x2,y2,0),vector(0,0,255),100);   
  	draw_line3d(vector(x1,y2,0),vector(0,0,255),100);   
  	draw_line3d(vector(x1,y1,0),vector(0,0,255),100);   
  	wait(1);  
  }
}



void main() {
	level_load(NULL);
	vec_set(&sky_color, COLOR_WHITE);
	draw_red_rect(10,10,100,100);
	while (1) {
		draw_point3d(vector(32, 0,  5), vector(0, 255, 255), 100, 2);
		wait(1);
	}
}


Posted By: jcl

Re: Wrong colors in built-in draw functions (8.10 public beta) - 12/20/10 10:01

I confirm this problem. In fact they were two problems, which will be fixed.

Unfortunately, we have to use a compatibility mode for disabling the fix. The draw_point3d function made points too bright in all A7 and A8 versions so far - full brightness was already at 128. That's why you didn't see a difference anymore. With the fix, full brightness will be at 256.
Posted By: Henning

Re: Wrong colors in built-in draw functions (8.10 public beta) - 01/11/11 12:07

Here is a simple workaround for wrong colored 3D lines,
just add a draw_point3d and the colors are back:

Code:
#include <acknex.h> 
#include <default.c>

function main () {
	
	level_load (NULL);
	wait (1);
	
	vec_set (camera.x, vector (50, -50, 15));
	vec_set (camera.pan, vector (135, 0, 0));
	
	while (1) {
		
		draw_line3d (vector (0,0,0), NULL, 100);
		draw_line3d (vector (0,0,0), vector (255,0,255), 100);
		draw_line3d (vector (0,0,30), vector (255,0,255), 100);
		draw_line3d (vector (0,0,30), NULL, 100);
		
		draw_point3d (vector (10,10,10), vector (0,255,0), 100, 5); 
		
		wait (1);
	}
}





© 2024 lite-C Forums