Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Dec 12, 2017 12:45 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Sun Jun 06, 2010 3:40 pm 
Offline

Joined: Thu Apr 02, 2009 7:24 am
Posts: 1
Hi, I'm a newbie to RB as well as OpenGL. The project I am working on is to create a 3D environment using OpenGL and then importing GPS points into a matrix which will then allow a mesh or surface to cover these point (assuming 3 or more points) and hereby creating a bit of a topographic landscape. Later on I would like to partition/divide the landscape into blocks which can be interactively selected.... Either way, I'd appreciate it if you could help and guide me a bit on how to start off using this plugin.... Step-by-step example code would be much appreciated... :)

PJ


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Tue Jun 08, 2010 11:08 am 
Offline

Joined: Fri Sep 30, 2005 8:39 pm
Posts: 364
Location: Arlington, TX
It is not a plug-in, it is a set of classes that work with RB's built-in functionality. First you need to import (or drag and drop) the OpenGLCore Module, the OpenGLMesh, OpenGLMatrix and OpenGLVector3D classes into your project. Then to create a new mesh you would add a Mesh property to your window and add the following code in the open event:
Mesh = New OpenGLMesh()

Mesh.VertexCount = GPSPositionCount ' number of 'points' you have in your mesh

For i = 0 To GPSPositionCount - 1
Mesh.Vertex( i ) = New OpenGLVector( GPSPosition( i ).X, GPSPosition( i ).Y, GPSPosition( i ).Z )
Next


Then add an OpenGLSurface to your window and put the following code in your render event.
Mesh.Render()


Now you may not see anything unless you have your camera set up, if you don't have it set up import the OpenGLCamera class, add a Camera property to your window. In the the Open event of the window add:
Camera = New OpenGLCamera()
Camera.Position.X = 5
Camera.Position.Y = 10
Camera.Position.Z = 15
Camera.Pitch = 45
Camera.PerspectiveAngle = 45


And for your OpenGLSurface rendering code it should look like this:
Camera.Setup()
Mesh.Render()


To move the camera around just change its Position (X,Y,Z) values with the keydown event.

_________________
Open Source OpenGL Classes:
Camera (1.1), Light (1.0), Texture (1.2), Font (1.2), Mesh (1.7), Models (1.0)


Top
 Profile  
Reply with quote  
 Post subject: Re: OpenGL Class #5 - Mesh (Open Source)
PostPosted: Sat Nov 03, 2012 1:27 pm 
Offline

Joined: Mon Jan 02, 2006 11:43 am
Posts: 172
Location: Calgary, Alberta, Canada
Hello Everyone,

Although this is a great example, this file throws errors in Real Studio 2012 r1.2 on a Windows 8 machine.

Sincerely,

Eugene


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours


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

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group