This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Clipping problem with DrawLine


Clipping problem with DrawLine

Postby adde » Nov 13, 2002 @ 5:24pm

Ok. I'm trying to write a VRML viewer using PF and I get the following problem with the DrawLine() function:

Everytime the line starts/ends outside the window, it get's distorted, ie: the clipping code doesn't do what it's suppose to do.

This fenomenon only occurs at the top and bottom of the window. Lines that end/start outside the window to the left or right is calculated correctly and just get cut off.

If you look closely, you can figure out that the lines that end/start outside the top of the window are drawn in the wrong direction from the point not outside the window. That is: It starts in the endpoint inside the window, has the right angle, but wrong direction.

The lines outside the bottom have yet another fault that I can't think of an easy way to explain.

I've looked at the code for DrawLine and found that is has it's own clipping calculator code based on an algoritm called Cohen-Sutherland. Has this somehow been wrongly implemented or is the error someplace else??

I've tried to resize the window back to 320x240 (running a h/pc so I have the PF window in 400x400) but the same thing happens.

Has anyone stumbled across this before, and how did you get past it??

It shure would be nice if the clipping worked as it should. Keeping track of all the line endpoints in a big VRML graph is not something you want to worry about.
User avatar
adde
pm Member
 
Posts: 152
Joined: Oct 9, 2002 @ 1:42pm
Location: Stockholm / Sweden


Postby Kzinti » Nov 13, 2002 @ 6:18pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Strike two

Postby adde » Nov 13, 2002 @ 8:30pm

User avatar
adde
pm Member
 
Posts: 152
Joined: Oct 9, 2002 @ 1:42pm
Location: Stockholm / Sweden


Strike two

Postby Kzinti » Nov 13, 2002 @ 10:04pm

Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron