If i export a mesh with 2 different surfaces (eg a cube with the ends textured with a different texture) how do i texture the separate bits?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu public void MoveEntity(float x, float y, float z)
{
SimpleVector dir;
dir=this.getXAxis(); // ?=X,Y,Z
dir.scalarMul(x);
this.translate(dir);
dir=this.getYAxis(); // ?=X,Y,Z
dir.scalarMul(y);
this.translate(dir);
dir=this.getZAxis(); // ?=X,Y,Z
dir.scalarMul(z);
this.translate(dir);
}
//PositionEntity
public void PositionEntity(float x, float y, float z) {PositionEntity(new SimpleVector(x, y, z));}
public void PositionEntity(SimpleVector dest)
{
this.setOrigin(dest);
this.clearTranslation();
if (_camera3D != null)
{
_camera3D.setPosition(dest);
}
if (_light != null)
{
_light.setPosition(dest);
}
}
//RotateEntity
public void RotateEntity(float x, float y, float z) {RotateEntity(new SimpleVector(x,y,z);}
public void RotateEntity(SimpleVector rotation)
{
//conversion to degrees?
_object3D.clearRotation();
_object3D.setRotationPivot(rotation);
}
//ScaleEntity
public void ScaleEntity(float x, float y, float z){ScaleEntity(new SimpleVector(x, y, z));}
public void ScaleEntity(SimpleVector size)
{
throw new NotImplementedException();
}
//TranslateEntity
public void TranslateEntity(float x, float y, float z) {TranslateEntity(new SimpleVector(x, y, z) );}
public void TranslateEntity(SimpleVector offset )
{
this.translate(offset);
}
public void TurnEntity(SimpleVector rotation) {TurnEntity(rotation.x, rotation.y, rotation.z);}
public void TurnEntity(float x, float y, float z)
{
this.rotateX(x);
this.rotateY(y);
this.rotateZ(z);
if (_camera3D != null)
{
SimpleVector rot = this.getRotationPivot();
_camera3D.rotateCameraX(rot.x);
_camera3D.rotateCameraY(rot.y);
_camera3D.rotateCameraZ(rot.z);
}
}
PositionEntity(float x, float y, float z) //or vector
{
//Sets the position of the object. (using world coords)
// is setOrigin(new SimpleVextor(xyz)); what i want?
}
MoveEntity(float x, float y, float z) //or vector
{
//moves the object in xyz from it's current position in relation to it's rotation.(using world coords)
}
TranslateEntity(float x, float y, float z) //or vector
{
//Similar to moveentity but moves the object from its current position but using a 0,0,0 rotation.
// does the existing translate do this?
}
TurnEntity(float x, float y, float z) //or vector
{
//turns the object in xyz at it's current position in relation to it's current rotation. (using world coords)
//At the moment i am using rotateX() which seems to be doing it, is this the best way?
}
RotateEntity(float x, float y, float z) //or vector
{
//Sets the rotation of the object. (using world coords)
}
run:
Loading Texture...box.jpg
Java version is: 1.6.0_20
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/opengl/Display
at com.threed.jpct.GLHelper.findMode(Unknown Source)
at com.threed.jpct.GLHelper.findMode(Unknown Source)
at com.threed.jpct.GLHelper.init(Unknown Source)
at com.threed.jpct.GLRenderer.init(Unknown Source)
at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
at HelloWorldOGL.loop(HelloWorldOGL.java:40)
at HelloWorldOGL.main(HelloWorldOGL.java:18)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.opengl.Display
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 9 more
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
private void loop() throws Exception {
buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_NORMAL);
buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
buffer.enableRenderer(IRenderer.RENDERER_OPENGL, IRenderer.MODE_OPENGL);
int a=1;
while (a!=2) {
box.rotateY(0.01f);
buffer.clear(java.awt.Color.BLUE);
world.renderScene(buffer);
world.draw(buffer);
buffer.update();
buffer.displayGLOnly();
Thread.sleep(10);
}
buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
buffer.dispose();
System.exit(0);
}
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control,
GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGIX_visual_select_group
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory,
GLX_MESA_copy_sub_buffer, GLX_MESA_swap_control,
GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_OML_sync_control,
GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync,
GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap
GLX version: 1.2
GLX extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_SGI_make_current_read,
GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,
GLX_EXT_texture_from_pixmap
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) 945GM GEM 20091221 2009Q4
OpenGL version string: 1.4 Mesa 7.7.1
OpenGL extensions:
Page created in 0.021 seconds with 12 queries.