Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, 1 invisible), 942 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Wrong colors in built-in draw functions (8.10 public beta) #350720
12/18/10 17:14
12/18/10 17:14
Joined: Dec 2008
Posts: 271
Saturnus Offline OP
Member
Saturnus  Offline OP
Member

Joined: Dec 2008
Posts: 271
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);
	}
}



Re: Wrong colors in built-in draw functions (8.10 public beta) [Re: Saturnus] #350795
12/19/10 10:22
12/19/10 10:22
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
I have the same problem with your code, I get the wrong colors with all versions, 7.86, 8.03 and 8.10.

Re: Wrong colors in built-in draw functions (8.10 public beta) [Re: Spirit] #350799
12/19/10 11:00
12/19/10 11:00
Joined: Dec 2008
Posts: 528
Wagga, Australia
the_mehmaster Offline
User
the_mehmaster  Offline
User

Joined: Dec 2008
Posts: 528
Wagga, Australia
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);
	}
}



Re: Wrong colors in built-in draw functions (8.10 public beta) [Re: the_mehmaster] #350910
12/20/10 10:01
12/20/10 10:01
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
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.

Re: Wrong colors in built-in draw functions (8.10 public beta) [Re: Saturnus] #353555
01/11/11 12:07
01/11/11 12:07
Joined: Jul 2007
Posts: 53
Germany
Henning Offline
Junior Member
Henning  Offline
Junior Member

Joined: Jul 2007
Posts: 53
Germany
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);
	}
}






Last edited by Henning; 01/11/11 12:13.

Moderated by  jcl, Nems, Spirit, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1