Crystal Space
Welcome, Guest. Please login or register.
December 20, 2014, 01:28:36 pm

Login with username, password and session length
Search:     Advanced search
9032 Posts in 2046 Topics by 9295 Members
Latest Member: Marioibuch
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  General Crystal Space Discussion
| | |-+  Lines
« previous next »
Pages: [1] Print
Author Topic: Lines  (Read 2583 times)
Jonathan
Guest


Email
« on: February 11, 2006, 01:57:26 pm »

I know I'm asking a lot of questions but I have a deadline.

Is there a way to draw a line between 2 points in 3d space? Apart from creating a mesh that is...

Jonathan
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #1 on: February 12, 2006, 09:16:53 pm »

I know I'm asking a lot of questions but I have a deadline.

Is there a way to draw a line between 2 points in 3d space? Apart from creating a mesh that is...

Jonathan

g3d->DrawLine(). Note that this will draw on top of all 3D geometry that is already present and it must be done in 2D mode.

Greetings,
Logged
Jonathan
Guest


Email
« Reply #2 on: February 13, 2006, 09:39:22 am »

Well I've done that and I cant see the line on the screen. Any ideas? I'm not sure what I should use for the color argument - which is an integer, what would red be?
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #3 on: February 13, 2006, 09:41:56 am »

Well I've done that and I cant see the line on the screen. Any ideas? I'm not sure what I should use for the color argument - which is an integer, what would red be?

Color you should get from iGraphics2D->FindRGB().

If it still doesn't work then show me the code.

Greetings,
Logged
Jonathan
Guest


Email
« Reply #4 on: February 13, 2006, 10:42:48 am »

Well the line of significance would be:

simple->getG3D()->DrawLine(thePoints[counter],thePoints[counter + 1],simple->getView()->GetCamera ()->GetFOVAngle(),simple->getG2D()->FindRGB(1,0,0));

This is straight after:

if(!g3d->BeginDraw (CSDRAW_2DGRAPHICS)) return;


The FOV is the only argument I'm not sure of. Should it be the same as the current camera?

Jonathan
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« Reply #5 on: February 13, 2006, 10:46:14 am »

Well the line of significance would be:

simple->getG3D()->DrawLine(thePoints[counter],thePoints[counter + 1],simple->getView()->GetCamera ()->GetFOVAngle(),simple->getG2D()->FindRGB(1,0,0));

This is straight after:

if(!g3d->BeginDraw (CSDRAW_2DGRAPHICS)) return;


The FOV is the only argument I'm not sure of. Should it be the same as the current camera?

Jonathan

Use GetFOV() instead of GetFOVAngle().

Also note that coordinates are in camera space.

Greetings,
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 2.211 seconds with 14 queries.