Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Login
Register
www.jpct.net
»
jPCT - a 3d engine for Java
»
Support
»
how to draw a 2D line with color in 3D world?
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: how to draw a 2D line with color in 3D world? (Read 4172 times)
qjvictor
int
Posts: 77
how to draw a 2D line with color in 3D world?
«
on:
November 23, 2006, 04:45:58 pm »
I need a 2D line to split the 3D world, and the 2D line should be in red or green, how could I do this?
and what's the pixel position of 2D line?
Thanks.
Logged
EgonOlsen
Administrator
quad
Posts: 12297
how to draw a 2D line with color in 3D world?
«
Reply #1 on:
November 23, 2006, 05:23:34 pm »
Using the software or the hardware renderer? A horizontal, vertical or arbitrary line?
Logged
qjvictor
int
Posts: 77
SOFTWARE render
«
Reply #2 on:
November 23, 2006, 05:53:26 pm »
The line's position will be changed according to the position of a 3D object in the screen. It depends on the camera's angle.
Is there any method to change the 3D position to 2D position in screen?
Logged
EgonOlsen
Administrator
quad
Posts: 12297
how to draw a 2D line with color in 3D world?
«
Reply #3 on:
November 23, 2006, 05:58:56 pm »
You can use Interact2D.project3D2D()...this thread covers a similar topic:
http://www.jpct.net/forum/viewtopic.php?t=663
However, when using the hardware renderer, you've to use the OpenGL-binding directly to draw the line. When using the software renderer, you can use Java2D for that.
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
www.jpct.net
»
jPCT - a 3d engine for Java
»
Support
»
how to draw a 2D line with color in 3D world?