2 registered members (7th_zorro, 1 invisible),
942
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
OP
Member
|
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.
#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: Spirit]
#350799
12/19/10 11:00
12/19/10 11:00
|
Joined: Dec 2008
Posts: 528 Wagga, Australia
the_mehmaster
User
|
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..
#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: Saturnus]
#353555
01/11/11 12:07
01/11/11 12:07
|
Joined: Jul 2007
Posts: 53 Germany
Henning
Junior Member
|
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:
#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.
|
|
|
|