www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Melssj5 on May 15, 2006, 01:18:41 am

Title: 2D Primitives
Post by: Melssj5 on May 15, 2006, 01:18:41 am
Hi, is ti posible to draw 2d primitives like Lines, circles, rectangles and things like that???? I need them for a homework and all my classmates are asking for a engine to do that.
Title: 2D Primitives
Post by: Mr.Marbles on May 15, 2006, 03:07:48 pm
This is probably not the best way, but you can use Primitives.getPlane() to create an Object3D plane and use setTransparency() on it. Then apply a texture that would have a drawing of your 2D shape on it.
Title: Re: 2D Primitives
Post by: raft on May 15, 2006, 05:52:03 pm
Quote from: "Melssj5"
Hi, is ti posible to draw 2d primitives like Lines, circles, rectangles and things like that???? I need them for a homework and all my classmates are asking for a engine to do that.

seems as java.awt.geom package is the engine you are looking for ;)

Quote
r a f t
Title: 2D Primitives
Post by: Melssj5 on May 15, 2006, 06:02:22 pm
I need to work with 2d primitives but in OpenGl. Any possibilities to do it in jpct?
Title: 2D Primitives
Post by: raft on May 15, 2006, 07:28:58 pm
i know almost nothing about open gl but i will most likely go after the Mr.Marbles' approach. java.awt.geom package can help to generate textures on the fly
Code: [Select]
r a f t
Title: 2D Primitives
Post by: EgonOlsen on May 15, 2006, 08:03:27 pm
Generating textures on the fly to do this is suitable if it's all part of a 3d application. But if this is a 2d application, i don't recommend to use jPCT for this at all...it's a 3d engine, not a function plotter.
Title: 2D Primitives
Post by: Melssj5 on May 16, 2006, 05:14:41 am
Ok, thanks. Anyway to draw just a point on a pixel?, I can manually draw the lines.